nuxt / nuxt/bridge

Can't find a module in the monorepo build

Open
#46 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug nitro
Dominant language
TypeScript
Stars
285
Forks
33
Avg merge
22h 38m
Merged PRs (30d)
3

Description

Environment
  • Operating System: Linux
  • Node Version: v17.1.0
  • Nuxt Version: 2.16.0-27305297.ab1c6cb4
  • Package Manager: yarn@1.22.17
  • Bundler: Webpack
  • User Config: rootDir, modulesDir, dev, bridge, alias, vite, nitro, env, publicRuntimeConfig, head, modules, css, buildModules, plugins, pwa, loading, build
  • Runtime Modules: cookie-universal-nuxt@2.1.5
  • Build Modules: @nuxt/bridge@3.0.0-27306170.bd36e13
Reproduction

https://codesandbox.io/s/blissful-tess-b5dyi

  • yarn build
Describe the bug

Can't find the tippy.js module when building, but it works in dev mode.

Additional context

I think @nuxt/bridge does not work properly in monorepo. It would be nice to have first-class support for monorepo.

Logs
ERROR  Rollup error: File /sandbox/services/web/tippy.js does not exist.             17:38:51


 FATAL  File /sandbox/services/web/tippy.js does not exist.                           17:38:51

  at Job.emitDependency (/sandbox/node_modules/@vercel/nft/out/node-file-trace.js:283:23)
  at async Promise.all (index 23)
  at async nodeFileTrace (/sandbox/node_modules/@vercel/nft/out/node-file-trace.js:35:5)
  at async Object.buildEnd (/sandbox/node_modules/@nuxt/nitro/dist/index.mjs:287:29)
  at async Promise.all (index 0)
  at async rollupInternal (/sandbox/node_modules/rollup/dist/es/shared/rollup.js:23394:5)
  at async _build (/sandbox/node_modules/@nuxt/nitro/dist/index.mjs:1085:18)
  at async /sandbox/node_modules/@nuxt/bridge/dist/chunks/module.mjs:219:7
  at async Nuxt.callHook (/sandbox/node_modules/hable/dist/hable.js:1:959)
  at async Builder.build (/sandbox/node_modules/@nuxt/builder-edge/dist/builder.js:264:5)
  at async Object.invoke (/sandbox/node_modules/nuxi/dist/chunks/build.mjs:33:5)
  at async _main (/sandbox/node_modules/nuxi/dist/chunks/index.mjs:382:7)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox and run yarn build, then compare its module resolution with dev mode in the Nuxt Bridge/Nitro build path. Done means the monorepo build resolves tippy.js instead of treating it as /sandbox/services/web/tippy.js and completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, nuxt
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.