Firebase Hosting Deploy Error ERR_PACKAGE_PATH_NOT_EXPORTED
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.11.1
- Nuxt Version:
3.0.0-27296423.f3082ca
- Package Manager:
yarn@1.22.17
- Bundler:
Vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
The problem happens on a fresh install of Nuxt using yarn or npm and by following the official Firebase Hosting guide with both methods: Using Nitro and Using Firebase CLI.
A minimal reproduction can be found on this git.
npx nuxi init nuxt3-app
cd nuxt3-app
yarn install
yarn global add firebase-tools
yarn add --dev firebase-admin firebase-functions firebase-functions-test
firebase init hosting
- Please select an option:
Use an existing project
- Select a default Firebase project for this directory:
<project name>
- What do you want to use as your public directory?
.output/public
- Configure as a single-page app (rewrite all urls to /index.html)?
No
- Set up automatic builds and deploys with GitHub?
No
NITRO_PRESET=firebase yarn build
firebase deploy
Describe the bug
At the beginning things seem to work:
=== Deploying to '<project-name>'...
i deploying functions, hosting
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i functions: ensuring required API artifactregistry.googleapis.com is enabled...
✔ functions: required API artifactregistry.googleapis.com is enabled
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
And then this issue happens:
Error: Error occurred while parsing your function triggers.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './runtime/polyfill/fetch.node' is not defined by "exports" in /Users/duran/Git/firebase-test/.output/server/node_modules/unenv/package.json imported from /Users/duran/Git/firebase-test/.output/server/index.mjs
at throwExportsNotFound (internal/modules/esm/resolve.js:292:9)
at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
at packageResolve (internal/modules/esm/resolve.js:612:14)
at moduleResolve (internal/modules/esm/resolve.js:662:14)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:755:11)
at Loader.resolve (internal/modules/esm/loader.js:97:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:243:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:46:40)
at link (internal/modules/esm/module_job.js:45:36)
Additional context
- firebase-tools version 9.23.0
- Blaze (pay-as-you-go) plan activated
- No logs on Firebase Web Console
- Tried with npm and yarn
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
firebase functions deploy error - Stack Overflow
I have read many solutions about the simillar problems, for example, remove node-modules and package-lock file then re-install them, down grade ...
Read more >Handling dependencies | Cloud Functions for Firebase - Google
An Artifact Registry Node.js package repository can host private modules for your function. When deploying to Cloud Functions, the build process will ...
Read more >Firebase web 9.0.1 error Package path . is not exported-node.js
[Solved]-Firebase web 9.0.1 error Package path . is not exported-node.js. Search. score:2. Try this: import * as firebase from "firebase/app".
Read more >Incident affecting Hosting - Firebase Status Dashboard
We are experiencing an issue Firebase Hosting serving HTTP 503 "time to first byte timeout" errors as of Tuesday, 2020-09-29 15:51 US/Pacific.
Read more >cloudbuild functions tsc not found - You.com | The AI Search ...
I am trying to use Google Cloud Build to deploy my Firebase functions, but I am running into a weird error. I have...
Read more >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 get similar errors for other libraries as well:
so maybe this is a more general issue?
I guess we shouldn’t have this issue anymore since the migration to nitropack. Please try with the latest dependencies (
npx nuxi upgrade --force
) and share a recent reproduction to investigate 🙏🏼