Closed cageq closed 8 months ago
could add this to vue.config.js to fix the error, is it correct?
module.exports = { chainWebpack: config => { config.module .rule('mjs') .test(/.(m?js|ts)$/) .include.add(/node_modules\/md-editor-v3/) // specify the package path .end()
.use('babel-loader')
.loader('babel-loader')
.end();
}
};
Maybe we need to upgrade the development environment
描述这个Bug
ERROR Failed to compile with 3 errors 10:06:32 AM
error in ./node_modules/md-editor-v3/lib/es/MdEditor.mjs
Module parse failed: Unexpected token (1082:30) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | s = s.concat(u); | const { lines: b } = n.state.doc;
@ ./node_modules/md-editor-v3/lib/es/index.mjs 1:0-46 30:0-45:2 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/Chat.vue?vue&type=script&lang=js @ ./src/Chat.vue?vue&type=script&lang=js @ ./src/Chat.vue @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/App.vue?vue&type=script&lang=js @ ./src/App.vue?vue&type=script&lang=js @ ./src/App.vue @ ./src/main.js @ multi (webpack)-dev-server/client?http://172.24.167.254:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./node_modules/@lezer/yaml/dist/index.js
@ ./node_modules/@codemirror/lang-yaml/dist/index.js 1:0-37 11:25-31 @ ./node_modules/@codemirror/language-data/dist/index.cjs @ ./node_modules/md-editor-v3/lib/es/index.mjs @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/Chat.vue?vue&type=script&lang=js @ ./src/Chat.vue?vue&type=script&lang=js @ ./src/Chat.vue @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/App.vue?vue&type=script&lang=js @ ./src/App.vue?vue&type=script&lang=js @ ./src/App.vue @ ./src/main.js @ multi (webpack)-dev-server/client?http://172.24.167.254:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
版本号
v20.11.0
问题重现链接
No response