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

[webpack5] DefinePlugin cannot read property 'get' of undefined #14497

Closed
moroine opened this issue Apr 7, 2021 · 26 comments
Closed

[webpack5] DefinePlugin cannot read property 'get' of undefined #14497

moroine opened this issue Apr 7, 2021 · 26 comments

Comments

@moroine
Copy link

moroine commented Apr 7, 2021

Describe the bug
I cannot build storybook using webpack5. I have the following error message with storybook v6.2.4:

/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/webpack/lib/DefinePlugin.js:549
						const oldVersion = compilation.valueCacheVersions.get(name);
						                                                  ^

TypeError: Cannot read property 'get' of undefined
    at /Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/webpack/lib/DefinePlugin.js:549:57
    at Array.forEach (<anonymous>)
    at walkDefinitionsForValues (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/webpack/lib/DefinePlugin.js:545:31)
    at /Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/webpack/lib/DefinePlugin.js:571:5
    at SyncHook.eval [as call] (eval at create (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:5:1)
    at SyncHook.lazyCompileHook (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.newCompilation (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/@storybook/core-server/node_modules/webpack/lib/Compiler.js:631:26)
    at /Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/@storybook/core-server/node_modules/webpack/lib/Compiler.js:667:29
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.compile (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/@storybook/core-server/node_modules/webpack/lib/Compiler.js:662:28)
    at /Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/@storybook/core-server/node_modules/webpack/lib/Watching.js:77:18
    at _next0 (eval at create (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:23:1)
    at eval (eval at create (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:32:1)
    at watchRunHook (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/webpack-virtual-modules/index.js:173:5)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/moroine/Workspace/Nugit/nugit-visualization/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:28:1)
error Command failed with exit code 1.

I rollback to v6.2.3 and it works (it's probably caused by dotenv-webpack upgrade.

To Reproduce

Here is my main.js (not the original but this minimal one causes the issue).

module.exports = {
  stories: [
    '../source/component/**/*.stories.jsx',
    '../src/client/**/*.stories.jsx',
  ],
  core: {
    builder: 'webpack5',
  },
};

System

Environment Info:

  System:
    OS: macOS 11.2.3
    CPU: (8) x64 Apple M1
  Binaries:
    Node: 12.18.4 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.6 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.114
    Safari: 14.0.3
  npmPackages:
    @storybook/addon-actions: 6.2.4 => 6.2.4
    @storybook/addon-console: ^1.2.3 => 1.2.3
    @storybook/addon-essentials: 6.2.4 => 6.2.4
    @storybook/addon-knobs: 6.2.4 => 6.2.4
    @storybook/addon-links: 6.2.4 => 6.2.4
    @storybook/addon-storyshots: 6.2.4 => 6.2.4
    @storybook/addon-storysource: 6.2.4 => 6.2.4
    @storybook/addon-viewport: 6.2.4 => 6.2.4
    @storybook/builder-webpack5: 6.2.4 => 6.2.4
    @storybook/react: 6.2.4 => 6.2.4

Additional context
Given the stack trace, it looks like @storybook/core-server is using webpack4 while root level is webpack5. Here is yarn why webpack

yarn why v1.22.10
[1/4] 🤔  Why do we have the module "webpack"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "webpack@5.30.0"
info Has been hoisted to "webpack"
info Reasons this module exists
   - Specified in "devDependencies"
   - Hoisted from "@storybook#builder-webpack5#webpack"
info Disk size without dependencies: "6.24MB"
info Disk size with unique dependencies: "12.6MB"
info Disk size with transitive dependencies: "24.72MB"
info Number of shared dependencies: 68
=> Found "@storybook/react#webpack@4.46.0"
info This module exists because "@storybook#react" depends on it.
info Disk size without dependencies: "2.41MB"
info Disk size with unique dependencies: "10.59MB"
info Disk size with transitive dependencies: "26.58MB"
info Number of shared dependencies: 111
=> Found "@storybook/core-common#webpack@4.46.0"
info This module exists because "@storybook#addon-storyshots#@storybook#core-common" depends on it.
info Disk size without dependencies: "2.56MB"
info Disk size with unique dependencies: "10.74MB"
info Disk size with transitive dependencies: "26.73MB"
info Number of shared dependencies: 111
=> Found "@storybook/builder-webpack4#webpack@4.46.0"
info This module exists because "@storybook#addon-essentials#@storybook#addon-docs#@storybook#builder-webpack4" depends on it.
info Disk size without dependencies: "2.78MB"
info Disk size with unique dependencies: "10.96MB"
info Disk size with transitive dependencies: "26.95MB"
info Number of shared dependencies: 111
=> Found "@storybook/core-server#webpack@4.46.0"
info This module exists because "@storybook#addon-storyshots#@storybook#core#@storybook#core-server" depends on it.
info Disk size without dependencies: "2.75MB"
info Disk size with unique dependencies: "10.93MB"
info Disk size with transitive dependencies: "26.92MB"
info Number of shared dependencies: 111
✨  Done in 1.60s.

┆Issue is synchronized with this Asana task by Unito

@shilman
Copy link
Member

shilman commented Apr 7, 2021

@paulrosania mind taking a look at this? i think at this point you know the most about this corner of Storybook 🙈

@thebuilder
Copy link
Contributor

Think I'm seeing a related issue when trying to build after upgrading to 6.2.4 - Getting the following error:


09:58:10.721 | ERR! => Failed to build the manager
-- | --
09:58:11.134 | ERR! ./node_modules/@storybook/semver/internal/debug.js
09:58:11.134 | ERR! Module parse failed: parser.isAsiPosition is not a function
09:58:11.134 | ERR! You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
09:58:11.134 | ERR! TypeError: parser.isAsiPosition is not a function
09:58:11.134 | ERR!     at /vercel/workpath0/node_modules/@storybook/core-server/node_modules/dotenv-webpack/node_modules/webpack/lib/DefinePlugin.js:233:18
09:58:11.134 | ERR!     at SyncBailHook.eval [as call] (eval at create (/vercel/workpath0/node_modules/@storybook/builder-webpack5/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)

@dunklesToast
Copy link

Having the exact same issue. Rolling back to v6.2.3 fixed it for me, too.

@shilman
Copy link
Member

shilman commented Apr 7, 2021

ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.5 containing PR #14501 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Apr 7, 2021
@dunklesToast
Copy link

Build works again! Thanks for the quick patch.

@tessro
Copy link
Contributor

tessro commented Apr 7, 2021

👀. Fascinating. Sorry about this. Looks like Webpack v5 is being hoisted now in some configurations, leading to the break.

I imagine the upgrade to dotenv-webpack causes Webpack 5 to now be hoisted instead of 4 if no version of Webpack is installed directly. This is quite a tangle, as Node's module resolution is going to depend on what gets hoisted, and what gets hoisted is going to depend on the (fluctuating!) number of internal dependencies Storybook has on Webpack and related deps.

I think when you move the manager build to Webpack 5 this is highly likely to rear its head again, since anything that shifts the balance of dependencies toward v5 is going to increase the odds of v5 getting hoisted. OTOH, if Storybook uses Webpack 5 exclusively internally (as opposed to a mix of 4 and 5) that might just work out fine, since the hoisted version would be correct.

@tessro
Copy link
Contributor

tessro commented Apr 7, 2021

Folks who suffered from this issue: would you be willing to try the following to help me debug what's going on here?

  1. Reinstall the broken version (v6.2.4)
  2. Share the version field from node_modules/webpack/package.json
  3. Share the version field from node_modules/dotenv-webpack/package.json

That would help me create a stable repro.

@dunklesToast
Copy link

FYI: We have a monorepo. We only use WebPack for Storybook but for reasons I also included yarn why output.

Validation that 6.2.4 is installed:

yarn why v1.22.10
[1/4] Why do we have the module "@storybook/core"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@storybook/core@6.2.4"

node_modules/webpack/package.json => 5.30.0

yarn why:

yarn why v1.22.10
[1/4] Why do we have the module "webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "webpack@4.46.0"
info Has been hoisted to "webpack"
info Reasons this module exists
   - "workspace-aggregator-35efa460-4ea1-4972-b979-03b15ae8b181" depends on it
   - Hoisted from "_project_#@xx#components#@storybook#react#webpack"
   - Hoisted from "_project_#@xx#components#@storybook#addon-docs#@storybook#builder-webpack4#webpack"
   - Hoisted from "_project_#@xx#components#@storybook#builder-webpack5#@storybook#core-common#webpack"
   - Hoisted from "_project_#@xx#components#@storybook#addon-docs#@storybook#core#@storybook#core-server#webpack"
info Disk size without dependencies: "8.59MB"
info Disk size with unique dependencies: "21.98MB"
info Disk size with transitive dependencies: "46.59MB"
info Number of shared dependencies: 183
=> Found "@storybook/builder-webpack5#webpack@5.30.0"
info This module exists because "_project_#@xx#components#@storybook#builder-webpack5" depends on it.
Done in 7.70s.

node_modules/dotenv-webpack/package.json => 6.0.4

yarn why v1.22.10
[1/4] Why do we have the module "dotenv-webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "dotenv-webpack@6.0.4"
info Reasons this module exists
   - "_project_#@xx#components#@storybook#builder-webpack5" depends on it
   - Hoisted from "_project_#@xx#components#@storybook#builder-webpack5#dotenv-webpack"
   - Hoisted from "_project_#@xx#components#@storybook#addon-docs#@storybook#builder-webpack4#dotenv-webpack"
   - Hoisted from "_project_#@xx#components#@storybook#addon-docs#@storybook#core#@storybook#core-server#dotenv-webpack"
info Disk size without dependencies: "48KB"
info Disk size with unique dependencies: "76KB"
info Disk size with transitive dependencies: "144KB"
info Number of shared dependencies: 2
Done in 4.28s.

If you need more info, let me know :)

@tessro
Copy link
Contributor

tessro commented Apr 7, 2021

This is super helpful, thank you. Taking a look now.

@tessro
Copy link
Contributor

tessro commented Apr 7, 2021

I have a solid repro case now, thank you for your debugging info!

# From an empty directory
npm init -y
npm install react{,-dom}@16
npm install -D @storybook/{addon-essentials,builder-webpack5,react}@6.2.4
mkdir .storybook
echo "module.exports = { core: { builder: 'webpack5' } };" > .storybook/main.js
npx start-storybook

@moroine
Copy link
Author

moroine commented Apr 8, 2021

v6.2.5 works on my side too!

I did check the versions of node_modules/webpack/package.json & node_modules/dotenv-webpack/package.json and I had the same as dunklesToast.

@matttk
Copy link

matttk commented Apr 13, 2021

This still happens for me and I'm on 6.2.7. I've cleared my node_modules and package-lock.json to make sure I am truly upgraded but it doesn't help. Is there something I might be missing?

@dunklesToast
Copy link

@matttk, could you send your package.json (dev)dependencies fields?

@matttk
Copy link

matttk commented Apr 13, 2021

@dunklesToast

    "@babel/cli": "^7.13.14",
    "@babel/core": "^7.13.15",
    "@babel/plugin-proposal-class-properties": "^7.13.0",
    "@babel/plugin-proposal-decorators": "^7.13.15",
    "@babel/plugin-proposal-object-rest-spread": "^7.13.8",
    "@babel/plugin-transform-react-constant-elements": "^7.13.13",
    "@babel/plugin-transform-react-inline-elements": "^7.12.13",
    "@babel/plugin-transform-runtime": "^7.13.15",
    "@babel/polyfill": "^7.12.1",
    "@babel/preset-env": "^7.13.15",
    "@babel/preset-react": "^7.13.13",
    "@storybook/addon-actions": "^6.2.7",
    "@storybook/addon-essentials": "^6.2.7",
    "@storybook/addon-links": "^6.2.7",
    "@storybook/addon-postcss": "^2.0.0",
    "@storybook/addon-storyshots": "^6.2.7",
    "@storybook/builder-webpack5": "^6.2.7",
    "@storybook/react": "^6.2.7",
    "acorn": "^8.1.1",
    "autoprefixer": "^10.2.5",
    "axios-mock-adapter": "^1.19.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.6.3",
    "babel-loader": "^8.2.2",
    "babel-plugin-inline-react-svg": "^1.1.2",
    "babel-plugin-webpack-alias": "^2.1.2",
    "babel-register": "^6.26.0",
    "browser-sync": "^2.26.14",
    "browser-sync-webpack-plugin": "^2.3.0",
    "commander": "^2.20.3",
    "concurrently": "^3.6.1",
    "copy-webpack-plugin": "^7.0.0",
    "cross-env": "^7.0.3",
    "css-loader": "^5.2.1",
    "enzyme": "^3.11.0",
    "enzyme-adapter-react-16": "^1.15.6",
    "enzyme-to-json": "^3.6.2",
    "eslint": "^7.24.0",
    "eslint-plugin-react": "^7.23.2",
    "expose-loader": "^1.0.3",
    "file-loader": "^6.2.0",
    "fs-extra": "^9.1.0",
    "identity-obj-proxy": "^3.0.0",
    "jest": "^26.6.3",
    "node-sass": "^5.0.0",
    "path-browserify": "^1.0.1",
    "postcss": "^8.2.10",
    "postcss-loader": "^4.1.0",
    "prettier": "2.2.1",
    "react-hot-loader": "^4.13.0",
    "react-is": "^17.0.2",
    "react-test-renderer": "^16.14.0",
    "sass": "^1.32.8",
    "sass-loader": "^10.1.1",
    "style-loader": "^2.0.0",
    "to-string-loader": "^1.1.6",
    "typescript": "^4.2.4",
    "uuid": "^8.3.2",
    "vis-util": "^4.3.4",
    "webpack": "^5.32.0",
    "webpack-bundle-tracker": "^0.4.3",
    "webpack-cli": "^4.6.0",
    "webpack-dev-server": "^3.11.2"

@dunklesToast
Copy link

Hmm. I've installed the same dependencies as you (added react and react-dom) and Storybook builds. Have you also deleted any storybook-static folder?
You could also try to clean your npm cache: npm cache clean --force

@matttk
Copy link

matttk commented Apr 13, 2021

Didn't help, unfortunately. I never had a storybook-static folder because I never run build-storybook. I only use npm run storybook.

Maybe my problem looks the same but is different...

image

@dunklesToast
Copy link

dunklesToast commented Apr 13, 2021

it actually looks the same like it did for me when i had the problem. Does rolling back to v6.2.5 work for you?

@matttk
Copy link

matttk commented Apr 13, 2021

I didn't try that but I did try rolling back to 6.2.3 and that did not help. I will try 6.2.5.

@dunklesToast
Copy link

Interesting. 6.2.3 should actually work I guess. Maybe @paulrosania knows more

@norbitrial
Copy link

norbitrial commented Apr 13, 2021

Maybe my problem looks the same but is different...

image

@matttk It looks like you have similar issue what explained here:
https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324#gistcomment-3704208

Mainly what solved the issue on my end is installing "dotenv-webpack": "^7.0.2" as npm install -D dotenv-webpack.

This SO answer gave me the idea, also see the reason for that here: #14403 (comment)

@matttk
Copy link

matttk commented Apr 13, 2021

OK, I've been reading a lot of different threads here and it seems what solved it for me was adding dotenv-webpack to dev dependencies (6.0.4 was enough) and html-webpack-plugin. Without the second one, I was just getting a different error (about snapshots). Now I seem to have moved past this error into into some unrelated ones.

postcss wasn't working. I followed the migration guide but this proved to not be enough. Step 3 from this post worked.

Edit: deleted last part of post - it was about an error with SCSS not being recognised but I hadn't updated my main.js to account for changes to webpack.config.js with the webpack 5 upgrade. Nothing worth sharing here.

Storybook is running now! 🎉

@jsg2021
Copy link

jsg2021 commented Apr 14, 2021

You will have this issue if you use the webpack5 builder and use parts of your own config that use webpack.DefinePlugin in your config...
webpack/webpack#13138

@jsg2021
Copy link

jsg2021 commented Apr 14, 2021

#14576 will probably solve this

@blainebell
Copy link

I have a solid repro case now, thank you for your debugging info!

# From an empty directory
npm init -y
npm install react{,-dom}@16
npm install -D @storybook/{addon-essentials,builder-webpack5,react}@6.2.4
mkdir .storybook
echo "module.exports = { core: { builder: 'webpack5' } };" > .storybook/main.js
npx start-storybook

Not sure if this is related to my problems, but I can reproduce errors with 6.2.9:

10% building 0/1 entries 0/0 dependencies 0/0 modulesℹ 「wdm」: wait until bundle finished: 
10% building 0/4 entries 4/9 dependencies 0/2 modulesThough the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
	["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
to the "plugins" section of your Babel config.
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
	["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
to the "plugins" section of your Babel config.
99% done plugins webpack-hot-middlewarewebpack built preview fd4cf7189f14ad0f287d in 14285ms
ModuleNotFoundError: Module not found: Error: Can't resolve 'lodash/get' in '/Users/blaine.bell/code/storybookTest/node_modules/telejson/dist'
Did you mean 'get.js'?
BREAKING CHANGE: The request 'lodash/get' failed to resolve only because it was resolved as fully specified
(probably because the origin is a '*.mjs' file or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
    at factory.create (/Users/blaine.bell/code/storybookTest/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/Compilation.js:1765:28)
    at hooks.factorize.callAsync (/Users/blaine.bell/code/storybookTest/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/NormalModuleFactory.js:730:13)
    at eval (eval at create (/Users/blaine.bell/code/storybookTest/node_modules/@storybook/builder-webpack5/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at hooks.resolve.callAsync (/Users/blaine.bell/code/storybookTest/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/NormalModuleFactory.js:273:22)
    at eval (eval at create (/Users/blaine.bell/code/storybookTest/node_modules/@storybook/builder-webpack5/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <an

@thutinavaneethreddy
Copy link

thutinavaneethreddy commented Jun 7, 2021

If someone is still looking around for a solution, here is what worked for me :

  1. npm install webpack@5.36.2 --save-dev
  2. npm install dotenv-webpack@6.0.4 --save-dev (This fixed "cannot read property 'get' of undefined" but gave a new issue about snapshots)
  3. npm install html-webpack-plugin@5.3.1 --save-dev (This fixed snapshot issue)
  4. In the build config in angular.json, change "optimization" : "false" to

"optimization": {
"styles": false,
"scripts": false,
"fonts": false
}

This fixed the warning - "Cannot read property 'minify' of undefined"

P.S: I followed all these steps while on storybook 6.2.7 version

leonm1 added a commit to VandyHacks/vaken that referenced this issue Jun 9, 2021
storybookjs/storybook#14497 and storybookjs/storybook#14403

tl;dr: Happo stopped working after #818 was merged, it turns out it is because
`npm run build-storybook` crashed due to the above issue(s).

Theoretically this is a workaround and can be removed after storybookjs/storybook#14403 is resolved, but there is no sign of when that'll happen

Deep technical reasons from the linked issue for why this fails:

> If npm hoists dotenv-webpack 6.0.4 to the node_modules root, everything works fine. However, if npm hoists dotenv-webpack 1.8, and the user has a .env file present, start-storybook fails to run.
>
> Unless the user is already pinning dotenv-webpack, the version that gets hoisted depends on how many dependencies are using 1.8 vs 6.0.4. (For example, in the repro steps below, if you remove @storybook/addon-essentials, npm hoists 6.0.4 and things work normally.) This makes for some extremely surprising and hard-to-pin-down behavior.
leonm1 added a commit to VandyHacks/vaken that referenced this issue Jun 9, 2021
storybookjs/storybook#14497 and storybookjs/storybook#14403

tl;dr: Happo stopped working after #818 was merged, it turns out it is because
`npm run build-storybook` crashed due to the above issue(s).

Theoretically this is a workaround and can be removed after storybookjs/storybook#14403 is resolved, but there is no sign of when that'll happen

Deep technical reasons from the linked issue for why this fails:

> If npm hoists dotenv-webpack 6.0.4 to the node_modules root, everything works fine. However, if npm hoists dotenv-webpack 1.8, and the user has a .env file present, start-storybook fails to run.
>
> Unless the user is already pinning dotenv-webpack, the version that gets hoisted depends on how many dependencies are using 1.8 vs 6.0.4. (For example, in the repro steps below, if you remove @storybook/addon-essentials, npm hoists 6.0.4 and things work normally.) This makes for some extremely surprising and hard-to-pin-down behavior.
@webbugt
Copy link

webbugt commented Nov 25, 2021

Maybe my problem looks the same but is different...
image

@matttk It looks like you have similar issue what explained here: https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324#gistcomment-3704208

Mainly what solved the issue on my end is installing "dotenv-webpack": "^7.0.2" as npm install -D dotenv-webpack.

This SO answer gave me the idea, also see the reason for that here: #14403 (comment)

This one saved me! I upgraded some "inherited" repos and was struggling with this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests