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

npx mocha -r dotenv-flow/config --recursive app not working on 4.0.0 but was fine on 3.2.0 #81

Closed
sombriks opened this issue Oct 24, 2023 · 1 comment · Fixed by #82
Closed
Labels
bug Something isn't working

Comments

@sombriks
Copy link

Hello, for some reason preload stopped working when i upgraded dotenv-flow from 3.2 to 4.0

i am running it on node 18, as long as i keep 3.2 things works fine.

Here's a sample error when running with 4.0:

[sombriks@lucien market-forecast]$ npx mocha -r dotenv-flow/config --recursive app

✖ ERROR: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './config' is not defined by "exports" in /home/sombriks/git/market-forecast/node_modules/dotenv-flow/package.json imported from /home/sombriks/git/market-forecast/node_modules/mocha/lib/nodejs/esm-utils.js
    at new NodeError (node:internal/errors:405:5)
    at exportsNotFound (node:internal/modules/esm/resolve:362:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:642:13)
    at packageResolve (node:internal/modules/esm/resolve:873:14)
    at moduleResolve (node:internal/modules/esm/resolve:939:20)
    at defaultResolve (node:internal/modules/esm/resolve:1132:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:524:22)
    at importModuleDynamically (node:internal/modules/cjs/loader:1188:29)
    at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)
    at importModuleDynamically (node:internal/vm:106:46)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:36:14)
    at exports.doImport (/home/sombriks/git/market-forecast/node_modules/mocha/lib/nodejs/esm-utils.js:35:34)
    at formattedImport (/home/sombriks/git/market-forecast/node_modules/mocha/lib/nodejs/esm-utils.js:32:18)
    at exports.requireOrImport (/home/sombriks/git/market-forecast/node_modules/mocha/lib/nodejs/esm-utils.js:42:34)
    at exports.handleRequires (/home/sombriks/git/market-forecast/node_modules/mocha/lib/cli/run-helpers.js:94:34)
    at async /home/sombriks/git/market-forecast/node_modules/mocha/lib/cli/run.js:349:25 {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
kerimdzhanov added a commit that referenced this issue Oct 30, 2023
…ield, fixes #81

This change fixes the issue with preloading `dotenv-flow/config` using Mocha's `-r` switch.
@kerimdzhanov
Copy link
Owner

Thanks for reporting @sombriks! 👍

@kerimdzhanov kerimdzhanov added the bug Something isn't working label Oct 30, 2023
kerimdzhanov added a commit that referenced this issue Nov 1, 2023
…ield, fixes #81 (#82)

This change fixes the issue with preloading `dotenv-flow/config` using
Mocha's `-r` switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants