-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
Description
Environment
| Operating system | Linux 5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 |
| CPU | Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (8 cores) |
| Node.js version | v22.22.0 |
| nuxt/cli version | 3.34.0 |
| Package manager | [email protected] |
| Nuxt version | 4.4.2 |
| Nitro version | 2.13.1 |
| Builder | [email protected] |
| Config | compatibilityDate, devtools |
| Modules | - |
Reproduction
https://stackblitz.com/edit/nuxt-starter-27yrcyhq
pnpm dev→ workspnpm build && pnpm preview→ surfaces the problem
Describe the bug
When a Nuxt module imports from nuxt/app (such as importing useAsyncData or useRequestHeaders), this leads to runtime crash in production build:
Cannot find module '.../.output/server/node_modules/nuxt/dist/app/types/augments' imported from .../.output/server/node_modules/nuxt/dist/app/index.js
Additional context
- Interestingly enough, there is empty
augments.jsunder that path. If I edit the import statement to import from '.../augments.js' (not from '.../augments') it goes further. - With
{ ssr: false }innuxt.config.ts, the problem doesn't repeat. - The problem is also gone if the module is added to
build.transpile, but that has its own significant drawbacks.
Downstream error: wobsoriano/trpc-nuxt#240
Logs
Reactions are currently unavailable