Failing build with NITRO_PRESET=firebase
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.11.0
- Nuxt Version:
3-3.0.0-27234133.44f8904
- Package Manager:
Yarn
- Bundler:
Webpack
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Describe the bug and expected behavior
Attempting to build the starter project and following the Firebase-specific instructions fails with the following error (full stack trace below):
ERROR Package subpath './package.json' is not defined by "exports" in /Users/username/code/project/myapp-nuxt3/node_modules/firebase-functions/package.json
Steps to reproduce
- Follow the instructions on https://v3.nuxtjs.org/docs/deployment/firebase
- Try to build with
NITRO_PRESET=firebase yarn build
(same results withNITRO_PRESET=firebase npm run build
)
Additional context
$ ~/c/s/myapp-nuxt3> NITRO_PRESET=firebase yarn build
yarn run v1.22.10
$ nuxt build
Nuxt CLI v3.0.0-27234133.44f8904 16:58:28
✔ Generated nuxt.d.ts 16:58:28
ℹ Vite warmed up in 698ms 16:58:29
ℹ Client built in 1110ms 16:58:30
ℹ Building server... 16:58:30
✔ Server built in 564ms 16:58:30
ℹ Nitro preset is firebase 16:58:30
ℹ Cleaning up .output 16:58:30
start Generating public... 16:58:30
✔ Generated public .output/public 16:58:30
start Building server... 16:58:30
start Writing server bundle... 16:58:47
✔ Server built 16:58:53
├─ .output/server/index.mjs (383 B) (175 B gzip)
├─ .output/server/chunks/nitro/firebase.mjs (8.64 MB) (1.27 MB gzip)
├─ .output/server/chunks/index.mjs (390 kB) (90.1 kB gzip)
├─ .output/server/chunks/app/vue3.mjs (588 B) (279 B gzip)
├─ .output/server/chunks/app/server.mjs (141 kB) (35.3 kB gzip)
├─ .output/server/chunks/app/render.mjs (24.3 kB) (6.71 kB gzip)
└─ .output/server/chunks/app/client.manifest.mjs (224 B) (157 B gzip)
Σ Total size: 9.19 MB (1.41 MB gzip)
ERROR Package subpath './package.json' is not defined by "exports" in /Users/username/code/project/myapp-nuxt3/node_modules/firebase-functions/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at writeRoutes$1 (node_modules/@nuxt/nitro/dist/index.mjs:1384:29)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was going to open a new issue but saw this one and I am now getting a different error but on the same command for build to firebase. See below for the bug report (I can open a new ticket if needed):
Environment
Linux
v14.18.1
(also occurs withv16.11.1
)3-3.0.0-27234503.d5127e9
Yarn
Webpack
-
-
-
Describe the bug and expected behavior
Upon following the instructions at https://v3.nuxtjs.org/docs/deployment/firebase for deploying to firebase via Nitro, an error occurs after the server is built. It appears the cli is trying to build the firebase functions package but is looking for the
package.json
in the wrong directory.Steps to reproduce
npx nuxi init nuxt3-app
.firebaserc
with project id from firebase (see https://v3.nuxtjs.org/docs/deployment/firebase)yarn add --dev firebase-admin firebase-functions firebase-functions-test
NITRO_PRESET=firebase yarn build
Additional context
Here is the full output from my console:
Yes no problems,
Here is the new issue for tracking Failing build with “NITRO_PRESET=firebase npm run build” gives pkgModulePaths is not iterable