Open netpalantir opened 1 year ago
I have the same issue!
I think, your babel-loader
should not process node_modules
. Do you have the ignore
option specified in babel config? It could override the default behaviour
I have the same issue!
try to add this to webpack config
rules: [{ test: /\.mjs$/, use: 'esbuild-loader' }],
If you are using Nuxt 2:
npm install esbuild-loader --save-dev
nuxt.config.js
build: {
extend(config, { isDev, isClient }) {
if (isClient) {
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
use: [
{
loader: 'esbuild-loader',
options: {
loader: 'jsx', // if you're using JSX
target: 'es2017' // set this to your desired ECMAScript version
}
}
]
});
}
}
}
rules: [{ test: /.mjs$/, use: 'esbuild-loader' }],
Bro, where to put this line exactly
If you are using Nuxt 2:
npm install esbuild-loader --save-dev
- Modify
nuxt.config.js
build: { extend(config, { isDev, isClient }) { if (isClient) { config.module.rules.push({ test: /\.mjs$/, include: /node_modules/, use: [ { loader: 'esbuild-loader', options: { loader: 'jsx', // if you're using JSX target: 'es2017' // set this to your desired ECMAScript version } } ] }); } } }
If after this you receive the "Element not defined" error, try importing editorJS in the mounted() lifecycle:
mounted() {
import('@editorjs/editorjs').then(module => {
const EditorJS = module.default;
this.editor = new EditorJS({
holder: 'editor'
});
}).catch(err => {
console.error('Failed to load module:', err);
});
}
Hello, I have been trying to add Editorjs to my Webpack 4 project, but unfortunately it does work only up to version 2.26.5.
As soon as I upgrade to 2.27.0 and up I get the following error (this one is obtained running @editorjs/editorjs@2.28.0)
Is there some incompatibility with my toolchain? How can I help fix/debug this? Thanks.