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.

[has workaround] Webpack v5 compatibility

See original GitHub issue

With Webpack v5 I failed to run plotly.js, it requires additional stream and assert libs. The complete problem description is available here https://github.com/quasarframework/quasar/issues/11229

As I was pointed Webpack v5 removed the Nodejs polyfills for the web client builds. It seems that plotly.js for the web client rely on Nodejs API , and I get errors saying that some packages are missing. These probably need to be addressed by the plotly.js communty.

For users, if you just want to run your app/website (with a bit of risk), then you can manually install node-polyfill-webpack-plugin which solves the problem.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

1reaction
mtgravescommented, Apr 14, 2022

@jmacura @ZodiacWind

…if it helps, for my react apps I ended up getting things to work by switching from importing like this:

import Plotly from "plotly.js";
import createPlotlyComponent from 'react-plotly.js/factory';

const Plot = createPlotlyComponent(Plotly);

to simply…

import Plot from 'react-plotly.js';

and I also (maybe related…maybe not but including for completeness) switched from the full plotly to a minified version. So my package.json went from:

"dependencies": {
    ...
    "plotly.js": "^1.58.4",
    "react-plotly.js": "^2.5.1",
    "react-scripts": "^4.0.3",
    ...
  },

to…

"dependencies": {
    ...
    "plotly.js-basic-dist-min": "^2.8.3",
    "react-plotly.js": "^2.5.1",
    "react-scripts": "5.0.0",
    ...
  },

Hope that helps?

0reactions
ZodiacWindcommented, Apr 16, 2022

@jmacura That’s great. Thanks for the information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v5 from v4 - webpack
Some Plugins and Loaders might have a beta version that has to be used in order to be compatible with webpack 5. Make...
Read more >
Top 5 Changes in webpack v5 - Ryan H. Lewis
Some of the third-party plugins might not support the changes in webpack v5 yet. A lot of the changes to the v5 internals...
Read more >
How to polyfill Buffer with Webpack 5 - viglucci.io
How to fix 'buffer is not defined' error and polyfill the Node.js ... Before Webpack v5, the polyfilling of many Node.js APIs would...
Read more >
Handling Webpack - Quasar Framework
Quasar App CLI is using Webpack v5. If you are moving your existing project to Quasar from a Webpack v4 project, you might...
Read more >
ts-loader - npm
There is an example of this in the official TypeScript Samples. Compatibility. TypeScript: 3.6.3+; webpack: 5.x+ (please use ts-loader 8.x ...
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