Skip to content

pnpm workspaces error: Cannot find module '@nuxthub/db' #826

@juankamilo

Description

@juankamilo

Describe the bug

ERROR  Failed to launch Drizzle Studio: Cannot find module '@nuxthub/db'
Require stack:

     ./test-hubdb/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_@cloudflare+wor_def6b336184af1243d24b5270c80723b/node_modules/@nuxthub/core/dist/module.mjs

    at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
    at Function.resolve (node:internal/modules/helpers:157:19)
    at jitiResolve (./test-hubdb/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:148703)
    at jitiRequire (./test-hubdb/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:150290)
    at import (./test-hubdb/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:158307)
    at ./test-hubdb/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_@cloudflare+wor_def6b336184af1243d24b5270c80723b/node_modules/@nuxthub/core/dist/module.mjs:891:96
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async launchDrizzleStudio (./test-hubdb/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_@cloudflare+wor_def6b336184af1243d24b5270c80723b/node_modules/@nuxthub/core/dist/module.mjs:891:24)

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a project with pnpm workspaces
  2. Create a nuxt 4.3 inside apps
  3. Install nuxthub
  4. Install Drizzle
  5. configure sqlite
  6. pnpm run dev, open devtools and launch Drizzle studio
  7. You can see the error on the console

Expected behavior
Must show the Drizzle studio

Reproduction
https://github.com/juankamilo/nuxthub-test-workspaces/

The module exist inside apps/test/node_modules/@nuxthub/db but not in the root node_modules, so when @nuxthub/core does import("@nuxthub/db"), Node.js resolves with a root path.

I think is an issue with the alias.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions