question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible with Webpack 5

See original GitHub issue

When adding this addon to a storybook using webpack 5, the following error occurs:

ERROR in ./node_modules/storybook-design-token/node_modules/postcss/lib/previous-map.js 8:35-50
Module not found: Error: Can't resolve 'path' in '/node_modules/storybook-design-token/node_modules/postcss/lib'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
 @ ./node_modules/storybook-design-token/node_modules/postcss/lib/input.js 10:42-67
 @ ./node_modules/storybook-design-token/node_modules/postcss/lib/parse.js 8:36-54
 @ ./node_modules/storybook-design-token/node_modules/postcss/lib/postcss.js 18:36-54
 @ ./node_modules/storybook-design-token/dist/parsers/postcss.parser.js 54:32-50
 @ ./node_modules/storybook-design-token/dist/hooks/useTokenTabs.js 11:23-59
 @ ./node_modules/storybook-design-token/dist/components/Panel.js 27:21-53
 @ ./node_modules/storybook-design-token/dist/register.js 9:14-43

Adding resolve.fallback to the webpack configuration per the instructions does not seem to work for me.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

3reactions
Sqrrlcommented, Jul 23, 2021

Published as v1.2.0

3reactions
Sqrrlcommented, Jun 17, 2021

Thanks for reporting. I will have a closer look as soon as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatible with Webpack 5 due to Buffer dependency #1029
I was finally able to make it works.. npm install assert browserify-zlib buffer process stream-browserify util. Then in my webpack config: const ...
Read more >
Incompatible with Webpack - Google Groups
I was trying to utilize Cesium in an application that utilizes Webpack and ran into numerous errors that state: "require function is used...
Read more >
To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. ... Webpack 5 requires at least Node.js 10.13.0 (LTS),...
Read more >
TsconfigPathsPlugin type not compatible with webpack 5
I'm trying to upgrade to webpack 5, but I'm now getting a type error when trying to use the TsconfigPathsPlugin.
Read more >
Error on faunadb driver for js, incompatible with webpack 5.67?
Just recently create a react app using creat-react-app, and install faunadb and zustand but everytime i tried to import faunadb the error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found