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

typescript import fails #75

Open
listvin opened this issue Nov 30, 2023 · 1 comment
Open

typescript import fails #75

listvin opened this issue Nov 30, 2023 · 1 comment

Comments

@listvin
Copy link

listvin commented Nov 30, 2023

typescript project
import "dotenv-defaults/config"

gives

/home/user/p/xxx/yyy/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366
    throw new ERR_MODULE_NOT_FOUND(
          ^
CustomError: Cannot find module '/home/user/p/xxx/yyy/node_modules/dotenv-defaults/config' imported from /home/user/p/xxx/yyy/src/index.ts
    at finalizeResolution (/home/user/p/xxx/yyy/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366:11)
    at moduleResolve (/home/user/p/xxx/yyy/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:801:10)
    at Object.defaultResolve (/home/user/p/xxx/yyy/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)
    at /home/user/p/xxx/yyy/node_modules/ts-node/src/esm.ts:218:35
    at entrypointFallback (/home/user/p/xxx/yyy/node_modules/ts-node/src/esm.ts:168:34)
    at /home/user/p/xxx/yyy/node_modules/ts-node/src/esm.ts:217:14
    at addShortCircuitFlag (/home/user/p/xxx/yyy/node_modules/ts-node/src/esm.ts:409:21)
    at resolve (/home/user/p/xxx/yyy/node_modules/ts-node/src/esm.ts:197:12)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
@listvin
Copy link
Author

listvin commented Nov 30, 2023

long story short it should be
import 'dotenv-defaults/config.js'
probably should be mentioned in readme

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