nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.28k stars 516 forks source link

netlify presets: [plugin impound] This module cannot be imported in server runtime #2846

Closed peralta closed 2 weeks ago

peralta commented 2 weeks ago

Environment

nuxi info output:

Nuxt project info:                                                    19:22:11

------------------------------
- Operating System: Linux
- Node Version:     v18.20.4
- Nuxt Version:     3.14.0
- CLI Version:      3.15.0
- Nitro Version:    2.10.2
- Package Manager:  pnpm@9.11.0
- Builder:          -
- User Config:      default
- Runtime Modules:  @nuxt/eslint@0.6.1, @nuxt/content@2.13.4, nuxt-time@0.1.3, nuxt-gtag@3.0.1, notivue/nuxt, @nuxtjs/sitemap@5.3.5, @nuxt/image@1.8.1, nuxt-jsonld@2.0.8, @nuxt/fonts@0.9.2, nuxt-purgecss@2.0.0, @nuxt/icon@1.6.1
- Build Modules:    -

Reproduction

NITRO_PRESET=netlify-legacy pnpm build in a recently upgraded nuxt project to v3.14.0

Describe the bug

Build fails when trying to use either netlify-legacy or netlify presets with the following error:

[19:21:13]  ERROR  [plugin impound] This module cannot be imported in server runtime. [importing node_modules/.pnpm/nitropack@2.10.2_typescript@5.6.3_webpack-sources@3.2.3/node_modules/nitropack/dist/presets/netlify/legacy/runtime/_deno-env-polyfill from node_modules/.pnpm/nitropack@2.10.2_typescript@5.6.3_webpack-sources@3.2.3/node_modules/nitropack/dist/presets/netlify/legacy/runtime/netlify.mjs]

Additional context

No response

Logs

No response

cfab commented 2 weeks ago

same here ! and same on nuxt: https://github.com/nuxt/nuxt/issues/29778

manniL commented 2 weeks ago

Seems like the import protection (impound) is triggering where it shouldn't.

aSchaffe commented 2 weeks ago

same issue

bnthor commented 2 weeks ago

Same issue

pi0 commented 2 weeks ago

This issue will be fixed in next patch release of Nuxt (https://github.com/nuxt/nuxt/pull/29780)

(if you could reproduce it without Nuxt, please consider openening a new issue in nitro repo)