bit icon indicating copy to clipboard operation
bit copied to clipboard

Missing dependencies for bit run app

Open KutnerUri opened this issue 2 years ago • 2 comments

Getting these errors when running bit app:

Error: Cannot find module 'webpack'
...
ERROR in ./node_modules/.pnpm/[email protected]/node_modules/graphql-tag/lib/index.js 2:0-32
Module not found: Error: Can't resolve 'graphql' in '/Users/kutner/projects/bit-uis/blog/node_modules/.pnpm/[email protected]/node_modules/graphql-tag/lib'
resolve 'graphql' in '/Users/kutner/projects/bit-uis/blog/node_modules/.pnpm/[email protected]/node_modules/graphql-tag/lib'
...
Error: Can't resolve 'subscriptions-transport-ws' in '/Users/kutner/projects/bit-uis/blog/node_modules/.pnpm/registry.npmjs.org+@[email protected][email protected]/node_modules/@apollo/client/link/ws'
resolve 'subscriptions-transport-ws' in '/Users/kutner/projects/bit-uis/blog/node_modules/.pnpm/registry.npmjs.org+@[email protected][email protected]/node_modules/@apollo/client/link/ws'
  Parsed request is a module
  using description file: /Users/kutner/projects/bit-uis/blog/node_modules/.pnpm/registry.npmjs.org+@[email protected][email protected]/node_modules/@apollo/client/link/ws/package.json

Some of these make sense - they are indirect peer dependencies of the code, like webpack and graphql.

However subscriptions-transport-ws is a dependency of bit, and should not appear here.

Steps to Reproduce

  1. bit import teambit.cloud/apps/bit-cloud
  2. bit install webpack (or the process won't even start)
  3. bit run bit-cloud-blog
  4. wait for it..
  5. --> getting the errors

Expected Behavior

Should install or warn about the missing the dependencies.

Screenshots, exceptions and logs

Specifications

  • Bit version: 726
  • Workspace type: harmony
  • Node version: 12.22.10
  • Platform: MacOS

KutnerUri avatar May 08 '22 14:05 KutnerUri

might be fixed by #6003

KutnerUri avatar Jun 23 '22 14:06 KutnerUri

Same mistake.

bit version: image

bit list: image

efengx avatar Jul 08 '22 07:07 efengx

this is a resolve of a missing peerDep, which was defined for in the env. to get these deps auto-installed, set rootComponents:true in workspace.jsonc.

itaymendel avatar Mar 06 '23 06:03 itaymendel