Closed yixinagqingyuan closed 2 years ago
Note that starting from v6.0, you need to install codemirror as well.
✅
yarn add codemirror vue-codemirror
❌
yarn add vue-codemirror
All are installed, but the installation will fail if you use yarn. NPM is OK
ok, In addition to using "@codemirror/state": "6.x", you also need to "install codemirror": "^6.0.1" when using yarn to install, NPM does not need to install codemirror ":" ^6.0.1“
Describe the bug
vite 2.9 use yarn instll build report errors
[vite]: Rollup failed to resolve import "codemirror" from "node_modules/vue-codemirror/dist/vue-codemirror.esm.js". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to
build.rollupOptions.external
error during build: Error: [vite]: Rollup failed to resolve import "codemirror" from "node_modules/vue-codemirror/dist/vue-codemirror.esm.js". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it tobuild.rollupOptions.external
at onRollupWarning (/Users/a58/58_project/idot-editor-vue/node_modules/vite/dist/node/chunks/dep-80fe9c6b.js:41772:19) at onwarn (/Users/a58/58_project/idot-editor-vue/node_modules/vite/dist/node/chunks/dep-80fe9c6b.js:41588:13) at Object.onwarn (/Users/a58/58_project/idot-editor-vue/node_modules/rollup/dist/shared/rollup.js:23226:13) at ModuleLoader.handleResolveId (/Users/a58/58_project/idot-editor-vue/node_modules/rollup/dist/shared/rollup.js:22510:26) at /Users/a58/58_project/idot-editor-vue/node_modules/rollup/dist/shared/rollup.js:22471:26use npm install normal
Reproduction
"vue-codemirror": "^6.0.0", report errors
System Info
Used Package Manager
yarn
Validations