teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
64 stars 9 forks source link

Vue Component always produces "document is not defined" when imported #138

Open maccesch opened 4 years ago

maccesch commented 4 years ago

Describe the bug

When I try to import my Vue component ComponentB that depends on another of my Vue component ComponentA on Bit and then try to use it in another Vue app it always says "document is not defined" at "webpack://component-a/....../vue-style-loader/lib/addStylesClient.js:123:22".

Steps to Reproduce

This happens whether I add the component through bit import ... or yarn add @bit/..... When I copy ComponentB into my project and modify the import statement to '@bit/my.collection.component-a' everything works as intended.

Specifications

Additional context

Both components are developed in the same project and work together nicely in this source project. They both build successfully and are exported to bit.dev.

The consuming project is a Nuxt.js project.

Both components are in a private collection. If you need access to reproduce, let me know.

GiladShoham commented 4 years ago

moved to the envs repo

jamiespink commented 4 years ago

I have the same issue. Does anyone have any idea how to resolve it? thanks