Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".mts" #3

Open
koakh opened this issue Jun 12, 2023 · 5 comments
Open

Comments

@koakh
Copy link

koakh commented Jun 12, 2023

when run project
it gives bellow error on server
any clue on how to solve it

@apps/server:dev: [nodemon] starting `ts-node src/server.mts`
@apps/server:dev: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".mts" for /mnt/storage/Development/Svelte/SvelteKit/SvelteKitPayloadCMSTRPCTurborepo/sk-trpc-payload/apps/server/src/server.mts
@apps/server:dev:     at new NodeError (node:internal/errors:399:5)
@apps/server:dev:     at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
@apps/server:dev:     at defaultGetFormat (node:internal/modules/esm/get_format:139:38)
@apps/server:dev:     at defaultLoad (node:internal/modules/esm/load:83:20)
@apps/server:dev:     at nextLoad (node:internal/modules/esm/hooks:735:28)
@apps/server:dev:     at load (/mnt/storage/Development/Svelte/SvelteKit/SvelteKitPayloadCMSTRPCTurborepo/sk-trpc-payload/node_modules/.pnpm/[email protected]_xe2tsftiwm5y3a5xnbnynihbxy/node_modules/ts-node/dist/child/child-loader.js:19:122)
@apps/server:dev:     at nextLoad (node:internal/modules/esm/hooks:735:28)
@apps/server:dev:     at Hooks.load (node:internal/modules/esm/hooks:380:26)
@apps/server:dev:     at MessagePort.handleMessage (node:internal/modules/esm/worker:165:24)
@apps/server:dev:     at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20) {
@apps/server:dev:   code: 'ERR_UNKNOWN_FILE_EXTENSION'
@apps/server:dev: }
@apps/server:dev: [nodemon] app crashed - waiting for file changes before starting...

awesome repo starter budie

thanks

@HanielU
Copy link
Owner

HanielU commented Jun 14, 2023

@koakh What is your node version?

@koakh
Copy link
Author

koakh commented Jun 19, 2023

hello @HanielU

first: thanks for your reply and awesome repo

second: sorry for the delay, I only see this message right now

my node version is

node -v
v20.2.0

thanks
but I can change for any other with nvm,
just say the version that you use and I change it

if I use latest LTS like v18.16.0 it fails with other errors, for ex

@apps/server:dev: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /mnt/storage/Development/Svelte/SvelteKit/SvelteKitPayloadCMSTRPCTurborepo/sk-trpc-payload/apps/server/src/trpc/router.mts
@apps/server:dev: require() of ES modules is not supported.

thanks

UPDATE: I think I fix it in node v18.16.0
project is already running, I made some changes to work with *nix, because the original project are to tied to windows, and we must change some things to work

I can make some notes of the changes and send or make a PR
but first I must test project and clean some things to have only the changes that are useful

@HanielU
Copy link
Owner

HanielU commented Jun 21, 2023

@koakh That's fine if you can make a PR

My node version

node -v
v18.12.1

@sudmann
Copy link

sudmann commented Jul 22, 2023

Any update on this?
I'm facing the same issue and would like to know how to resolve it.

@koakh
Copy link
Author

koakh commented Jul 24, 2023

What problem do you have,
This one?
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".mts"

In my case, I solve it using

node -v
v18.12.1

Like it was reported above, if you have any other problem, please specify it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants