VuePress cannot coexist with Vue CLI generated app?
See original GitHub issue- I confirm that this is an issue rather than a question.
Bug report
Steps to reproduce
https://github.com/bencodezen/vuepress-coexist-error
- Install dependencies via
yarn
- Run
yarn docs
to start VuePress instance - Open http://localhost:8080
- See the following error in JavaScript Console
[Vue warn]: Failed to resolve async component: function Layout() {
return __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! ./node_modules/@vuepress/theme-default/layouts/Layout.vue */ "./node_modules/@vuepress/theme-default/layouts/Layout.vue"));
}
Reason: TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
warn @ webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:620
How to See Success State
- Change directory to
/docs
- Install dependencies via
yarn
- Run
yarn docs
to start VuePress instance - Open http://localhost:8080
- Everything looks great!
What is expected?
User should be able to run VuePress in the same package.json
file with an existing Vue CLI 3 app without any errors.
What is actually happening?
Seems like there is a conflict with how something is being called in webpack.
Other relevant information
- Output of
npx vuepress info
in my VuePress project:
Environment Info:
System:
OS: macOS 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.17.0 - /usr/local/bin/yarn
npm: 6.10.2 - /usr/local/bin/npm
Browsers:
Chrome: 76.0.3809.100
Firefox: 68.0.2
Safari: 12.1.2
npmPackages:
@vuepress/core: 1.0.3
@vuepress/theme-default: 1.0.3
vuepress: ^1.0.3 => 1.0.3
npmGlobalPackages:
vuepress: Not Found
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
VuePress site generated by `vuepress build` doesn't call ...
I created a custom theme for VuePress that extends the @vuepress/theme-default to add some new Vue components. All works fine when I use ......
Read more >vue/cli-plugin-pwa
The path of app's manifest. If the path is an URL, the plugin won't generate a manifest.json in the dist directory during the...
Read more >Introduction | VuePress
VuePress is composed of two parts: a minimalistic static site generator with a Vue-powered theming system and Plugin API, and a default theme ......
Read more >Deployment - Vue CLI
If you are using Vue CLI along with a backend framework that handles static assets as part of its deployment, all you need...
Read more >Hot Reload | Vue Loader
vue file, all instances of that component will be swapped in without reloading the page. It even preserves the current state of your...
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
This is a pretty big deal. I have an existing Vue project - which uses vue-cli, like a lot of Vue projects. I currently can’t add VuePress to it until this is fixed - it’s currently completely broken and produces no output.
PR #1771 should fix this.
The problem, which the PR addresses, is that
@vuepress/*
path. That includes dependencies that might be located at/node_modules/@vuepress/core/node_modules
/node_modules/@vuepress/core/node_modules/core-js
. This dependecy is already transpiled ot ES5 and uses commonjs module syntax.I believe that an adjustment of the babel config like the following could help working around the issue
…which should tell babel that it’s transpiling commonjs in that core-js folder and make it work.
However I can’t test this right now. Either way this is just a band-aid and has to be solved properly in the webpack config.