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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_UNKNOWN_FILE_EXTENSION when using ts-node-esm #916

Open
kylerush opened this issue Sep 22, 2022 · 0 comments
Open

ERR_UNKNOWN_FILE_EXTENSION when using ts-node-esm #916

kylerush opened this issue Sep 22, 2022 · 0 comments

Comments

@kylerush
Copy link

First off just wanted to say that I love this package. It's so simple and straightforward. Thank you to everyone who has worked on it 馃檹

I am attempting to migrate my current TypeScript/CJS project to TypeScript/ESM and I'm having some issues with this package. I am getting this error:

ts-node-esm ./node_modules/.bin/node-pg-migrate -j ts up

/Users/kylerush/projects/backend/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js:93
        throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url));
              ^
CustomError: ERR_UNKNOWN_FILE_EXTENSION  /Users/kylerush/projects/backend/node_modules/node-pg-migrate/bin/node-pg-migrate
    at defaultGetFormat (/Users/kylerush/projects/backend/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js:93:15)
    at defer (/Users/kylerush/projects/backend/node_modules/ts-node/src/esm.ts:296:7)
    at entrypointFallback (/Users/kylerush/projects/backend/node_modules/ts-node/src/esm.ts:304:22)
    at getFormat (/Users/kylerush/projects/backend/node_modules/ts-node/src/esm.ts:338:26)
    at /Users/kylerush/projects/backend/node_modules/ts-node/src/esm.ts:245:17
    at addShortCircuitFlag (/Users/kylerush/projects/backend/node_modules/ts-node/src/esm.ts:409:21)
    at load (/Users/kylerush/projects/backend/node_modules/ts-node/src/esm.ts:239:12)
    at load (/Users/kylerush/projects/backend/node_modules/ts-node/src/child/child-loader.ts:18:36)
    at nextLoad (node:internal/modules/esm/loader:163:28)
    at ESMLoader.load (node:internal/modules/esm/loader:602:26)

I have this in my package.json:

"migrate": "ts-node-esm ./node_modules/.bin/node-pg-migrate -j ts --ignore-pattern *.md"

Any idea on something I can do on my end to get the migration to run?

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

1 participant