Import not working with webpack+babel
See original GitHub issueI’d like to use chartist in the manner below. My workflow uses webpack and babel.
import Chartist from ‘chartist’;
This throws the following in the browser: Uncaught TypeError: Cannot set property 'Chartist' of undefined
I have got around this by forking chartist and tweaking the factory code in the manner described here: https://github.com/gregjacobs/Autolinker.js/issues/86#issuecomment-74487812
It would be great if this could be incorporated into the master branch.
Issue Analytics
- State:
- Created 8 years ago
- Comments:23 (1 by maintainers)
Top Results From Across the Web
Plain "import" is not working with webpack and babel-loader
In my main.js I imported some other js files which do not have export statements. //main.js import './file1' instead import styles from '....
Read more >Dynamic imports not working (TypeScript, Babel) #8669
My dynamic imports are not working although I think I have configured things correctly. The error: ERROR in ./src/js/utils/getIconUrl.ts 4:2 ...
Read more >Module Methods
Version 2 of webpack supports ES6 module syntax natively, meaning you can use import and export without a tool like babel to handle...
Read more >Working with Babel 7 and Webpack | The Basement
The easiest way to import the polyfills provided by Babel is by including it in your entry point in Webpack. Change your webpack.config.js...
Read more >Fixing WebpackChunkName for Dynamic Imports - Time to Hack
Are the Webpack Magic Comments webpackChunkName not effective and working with Babel? See how to Fix it and Tips to avoid related problems....
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
three years later, and this still seems to be an issue. why is this closed? both
import Chartist from 'chartist'
andrequire('chartist')
lead to this error for meedit: using
0.10.1
Import works flawlessly. As stated in another issue, not all plugins return functions.
import Chartist from 'chartist'
worked perfectly.