Skip to content

"Cannot assign to read only property 'exports' of object '#<Object>'" when importing library  #2675

@mrodal

Description

@mrodal

Version

3.0.4

Reproduction link

https://github.com/mrodal/vue-cli-lib-ts-error

Node and OS info

npm 6.4.1/node 10.11.0/Windows 10

Steps to reproduce

Create project to be a library with vue-cli. Options: just babel
Create entry file exporting the hello world component
Build library with vue-cli-service build --target lib --name lib index.js

Create host project. Options: just babel
npm install the library project
use an import statement importing the component

What is expected?

Import successfull

What is actually happening?

Cannot assign to read only property 'exports' of object '#<Object>'


I think it may be related to versions of webpack, vue libraries or something like that, because I have another project that I cannot share because its private, and there, the import works as expected.

In that project that works, if I remove node_modules and package-lock.json and install everything again, it stops working and the same error appears.

The new package-lock.json has different versions on the package's requires even if the package has the same version in both files...

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs team reproWe acknowledged your report and will soon try to reproduce it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions