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 "" for ... tsc #3900

Closed
andreialecu opened this issue Dec 22, 2021 · 0 comments · Fixed by #4289
Closed

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for ... tsc #3900

andreialecu opened this issue Dec 22, 2021 · 0 comments · Fixed by #4289
Labels
bug Something isn't working esm upholded Real issues without formal reproduction

Comments

@andreialecu
Copy link
Contributor

andreialecu commented Dec 22, 2021

This was probably introduced by #3667 - at least it made it more visible (cc @merceyz)

Here's a repro:

corepack enable npm
cd `mktemp -d`
yarn init -2
yarn set version from sources
yarn config set pnpEnableEsmLoader true
yarn
NODE_OPTIONS="--loader $PWD/.pnp.loader.mjs" yarn add test@andreialecu/nestjs-sentry#aa/refactor
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /private/var/folders/9p/k1yqxx0d7rn1nlztg_wm7sbw0000gn/T/xfs-1ff1050a/node_modules/typescript/bin/tsc
    at new NodeError (node:internal/errors:371:5)

Note that in my actual project I'm not adding NODE_OPTIONS="--loader $PWD/.pnp.loader.mjs" manually. Yarn does that itself for some reason which is probably related to heuristics where it finds that one of my dependencies needs it.

Originally posted by @andreialecu in #3832 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working esm upholded Real issues without formal reproduction
Projects
None yet
2 participants