You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use node -r dotenv-expand/config, it throws following error
❯ node -r dotenv-expand/config
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/env-options' is not defined by "exports" in /home/projects/node-bdyl5f/node_modules/dotenv/package.json
at throwExportsNotFound (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:488525)
at packageExportsResolve (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:491222)
at resolveExports (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:182519)
at Function.Module._findPath (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:183031)
at Function.Module._resolveFilename (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:188095)
at Function.Module._load (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:185865)
at Module.require (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:189078)
at i (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:443011)
at _0x4248b4 (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:15:95063)
at eval (/home/projects/node-bdyl5f/node_modules/dotenv-expand/config.js:6:7) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
This is due to lib/cli-options and lib/env-options are not exported from dotenv.
After monkey patching the exports under node_modules/dotenv/package.json with exports: {"./lib/*": "./lib/*.js"} I get another error
❯ node -r dotenv-expand/config
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/env-options' is not defined by "exports" in /home/projects/node-bdyl5f/node_modules/dotenv/package.json
at throwExportsNotFound (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:488525)
at packageExportsResolve (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:491222)
at resolveExports (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:182519)
at Function.Module._findPath (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:183031)
at Function.Module._resolveFilename (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:188095)
at Function.Module._load (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:185865)
at Module.require (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:189078)
at i (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:6:443011)
at _0x4248b4 (https://node-bdyl5f.w.staticblitz.com/blitz.d64d45524a435df425e7813603b52872ecfbe08e.js:15:95063)
at eval (/home/projects/node-bdyl5f/node_modules/dotenv-expand/config.js:6:7) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
This requires changes in the following line of config.js
#31 seems to have introduced a bug.
When I try to use
node -r dotenv-expand/config
, it throws following errorThis is due to
lib/cli-options
andlib/env-options
are not exported fromdotenv
.After monkey patching the exports under
node_modules/dotenv/package.json
withexports: {"./lib/*": "./lib/*.js"}
I get another errorThis requires changes in the following line of
config.js
return dotenvExpand(env)
=>return dotenvExpand.expand(env)
.After this, the command works out fine.
The issue can be reproduced here
The text was updated successfully, but these errors were encountered: