envs icon indicating copy to clipboard operation
envs copied to clipboard

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

Open maccesch opened this issue 5 years ago • 2 comments

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

  • Bit version: 14.7.6
  • Node version: v12.16.2
  • npm / yarn version: 1.22.4
  • Platform: Windows 10
  • Bit compiler (include version): bit.envs/compilers/[email protected]
  • Bit tester (include version): N/A

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.

maccesch avatar May 12 '20 18:05 maccesch

moved to the envs repo

GiladShoham avatar May 14 '20 18:05 GiladShoham

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

jamiespink avatar Jul 03 '20 15:07 jamiespink