Can't import the named export 'parse' from non EcmaScript module (only default export is available)
See original GitHub issueSucrase does not work with webpack
import sucrase from 'sucrase'
Webpack config
let webpack = require('webpack')
// CSS
let MiniCssExtractPlugin = require('mini-css-extract-plugin')
let autoprefixer = require('autoprefixer-stylus')
// Config
module.exports = {
entry: './examples/app.js',
resolve: {
extensions: ['.js', '.styl']
},
module: {
rules: [
{
test: /\.styl$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
hmr: true,
reloadAll: true
}
},
{
loader: 'css-loader',
options: {
modules: false
}
},
{
loader: 'stylus-loader',
options: {
use: [autoprefixer()]
}
}
],
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-syntax-jsx', '@babel/plugin-transform-react-jsx']
}
}
}
],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new webpack.ProvidePlugin({
ReactDOM: 'react-dom',
React: 'react'
})
],
devServer: {
contentBase: './examples',
historyApiFallback: true,
inline: true,
hot: true,
port: 80
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Can't import the named export XXXX from non EcmaScript ...
the solution is to make sure that you have a webpack.config.js file in the root of your project directory that looks something like...
Read more >Can't import the named export from non EcmaScript module ...
mjs Can't import the named export 'set' from non EcmaScript module (only default export is available) error in ./node_modules/pinia/dist/pinia.
Read more >Can't import the named export from non EcmaScript module
Hi My site name is stupefied-lamarr-20c8d9 On the server side of my app I have lambda functions and within those I'm using apollo-server-lambda...
Read more >webpack/webpack - Gitter
Can't import the named export 'a' from non EcmaScript module (only default export is available) ERROR in ./node_modules/@ionic/core/dist/esm/loader.mjs 7:4- ...
Read more >webpack from non ecmascript module (only default export is ...
Can't import the named export 'AggregateError' from non EcmaScript module (only default export is available) After researching, I've found out that this is ......
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 made a fork which works for CRA, Gatsby etc -
yarn add sucrase-browser
https://github.com/reactioncommerce/reaction-component-library/issues/399#issuecomment-467860022