Skip to content

VuePress cannot coexist with Vue CLI generated app? #1807

Closed
@bencodezen

Description

@bencodezen
  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

https://github.com/bencodezen/vuepress-coexist-error

  1. Install dependencies via yarn
  2. Run yarn docs to start VuePress instance
  3. Open http://localhost:8080
  4. 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

  1. Change directory to /docs
  2. Install dependencies via yarn
  3. Run yarn docs to start VuePress instance
  4. Open http://localhost:8080
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions