unjs / nitro

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

Firebase deployment failed : npm error notsup Unsupported platform for @css-inline/css-inline-win32-x64-msvc@0.14.1: wanted {"os":"win32","cpu":"x64"} (current: {"os":"linux","cpu":"x64"}) #2604

Closed davemg3 closed 2 months ago

davemg3 commented 2 months ago

Environment

Operating System: Win32 Node Version: v20.13.1 Nuxt Version: 3.10.0 Nitro : 2.9.6 Package Manager: npm@10.5.2

Reproduction

Here is a stackblitz but bugs cannot be reproduced there as issue is during deployment (everything is ok on local host or using container docker) : https://stackblitz.com/edit/nuxt-starter-chpjoh?file=pages%2Findex.vue,tsconfig.json,package.json,nuxt.config.ts

Describe the bug

Issue is created by using package : "@nuxtjs/seo": "^2.0.0-rc.11",

and running on local win32 laptop :

  • npm install -g firebase-tools@latest
  • firebase login
  • firebase init hosting
  • npm run build -- --preset=firebase within .../app/.output/server folder: - npm install within app folder : - firebase deploy

nuxtjs/seo us 2 packages : "@css-inline/css-inline": "0.14.1", "@resvg/resvg-js": "2.6.2",

When using above instructions it adds in .output/server 4 packages :

"@css-inline/css-inline":"0.14.1", @css-inline/css-inline-win32-x64-msvc":"0.14.1", "@resvg/resvg-js":"2.6.2" "@resvg/resvg-js-win32-x64-msvc"

And it creates following error message during deployment :

i functions: updating Node.js 20 (2nd Gen) function server(europe-west1)...
Build failed with status: FAILURE and message: npm error code EBADPLATFORM
npm error notsup Unsupported platform for @css-inline/css-inline-win32-x64-msvc@0.14.1: wanted {"os":"win32","cpu":"x64"} (current: {"os":"linux","cpu":"x64"})
npm error notsup Valid os: win32
npm error notsup Actual os: linux
npm error notsup Valid cpu: x64
npm error notsup Actual cpu: x64

Packages generated into .output/server should be tied to linux OS used by server and not local OS win 32. It looks very similar to this issue : https://github.com/nuxt/nuxt/issues/21393

Additional context

Using following instructions : https://nuxt.com/deploy/firebase https://nitro.unjs.io/deploy/providers/firebase https://nuxtseo.com/og-image/getting-started/getting-familar-with-nuxt-og-image

Logs

No response

davemg3 commented 2 months ago

Other linked open issue : https://github.com/harlan-zw/nuxt-seo/issues/266

pi0 commented 2 months ago

Hi, dear @davemg3 thanks for reporting i understand it might be an issue in your project but this is not a nitro bug directly but a problematic dependency that nuxt-seo module introduces. in order to track issues in nitro, we need minimal reproductions (a nitro-only example)

I would suggest to please track via https://github.com/harlan-zw/nuxt-seo/issues/266 for follow up.