Error in Storybook - LinearScaleBase is not defined
See original GitHub issueExpected behavior
No bug of not used features.
Current behavior
Hey guys, After updating from 3.9.1 to 4.0.1 I receive error in our builded Storybook (runtime not on build):
Uncaught ReferenceError: LinearScaleBase is not defined
at ./node_modules/chart.js/dist/chart.js (5827.4a9359bf.iframe.bundle.js:2:4868810)
at __webpack_require__ (runtime~main.bfd8d355.iframe.bundle.js:1:387)
at ./src/components/common/DoughnutChart.js (main.ee1fcde1.iframe.bundle.js:1:1188558)
- Running locally I don’t have such error.
- LinearScaleBase is not something I use anywhere in the codebase
Any suggestions?
Reproducible sample
None
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
v4.0.1
Browser name and version
No response
Link to your project
No response
Issue Analytics
- State:
- Created 10 months ago
- Reactions:4
- Comments:5
Top Results From Across the Web
Frequently Asked Questions - Storybook - JS.ORG
A common error is that an addon tries to access the "channel", but the channel is not set. It can happen in a...
Read more >Storybook - no stories showing up in typescript project with ...
When trying to create a story from my components, I get the error: Module not found: Error: Can't resolve 'esri/Basemap' in '/.../GitHub/20-maps ...
Read more >storybook/addon-docs - npm
Start using @storybook/addon-docs in your project by running `npm i ... When set to null it tells docs not to run the source-loader...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this same issue when I only had a Doughnut chart in my project but later added a Line Chart, which required registering LinearScale (along with CategoryScale, PointElement, and LineElement) and it worked thereafter. Try registering LinearScale first to see if that addresses your problem and add some of these other Line Chart components if it’s still not working for you.
thank you @duyn-stanford for this suggestion. I imported LinearScale, and also had to register it with Chart.js, but now the production build works. Not exactly a “clean” solution, but certainly works, so much appreciated!