question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package path ./standalone is not exported from package database-compat

See original GitHub issue

Background

Hello everyone, I’ve just installed the admin SDK and it’s bringing me the following error:

error - ./node_modules/firebase-admin/lib/app/firebase-namespace.js:106:0
Module not found: Package path ./standalone is not exported from package D:\NewRepos\1d3a\node_modules\@firebase\database-compat (see exports field in D:\NewRepos\1d3a\node_modules\@firebase\database-compat\package.json)

Import trace for requested module:
./node_modules/firebase-admin/lib/default-namespace.js
./node_modules/firebase-admin/lib/index.js
./lib/firebaseAdminSdk.ts

I’ve found this StackOverflow post regarding this, but he has not gotten answers. The only other information I have on this error is that this warning comes up when checking the relevant package’s package.json file: image

Relevant Code:

import { initializeApp, apps, app } from 'firebase-admin';
import { credential } from "firebase-admin"

var firebaseAdminAccount = require("../serviceAccount.json");

var FbApp : app.App = null;

if(!apps.length)
{
  FbApp = initializeApp({
    credential: credential.cert(firebaseAdminAccount)
  })
}

if(FbApp === null)
{
  FbApp = apps[0];
}

export default FbApp;

This code is for getting the admin SDK in my backend, and not trying to initialize it twice. It’s important to note, this crashes at the imports, and not the code itself.

does anyone know how to fix this? I cannot run my site because of this.

Environment

OS: Windows 10 Firebase SDK Ver: ^11.0.1 Firebase Product: auth, but happens at initialization. Node.js: v18.7.0 NPM: v8.15.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ArchyInUsecommented, Aug 8, 2022

Hi, I have recently realized that next.js middleware runs on V8, which firebase-admin cannot run at. I thought the middleware was node.js and therefor would run fine. Either way, now I gotta figure out how to run authorization before API call code all over again. Thanks for the comment though

0reactions
fontofulcommented, Dec 21, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ask Question - Stack Overflow
Package path ./standalone is not exported from package ... not exported from package D:\NewRepos\1d3a\node_modules@firebase\database-compat ...
Read more >
(React) Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
package path not exported error. Open your terminal in your project's root directory (where your package.json file is) and run the following commands....
Read more >
Module not found: Error: Package path . is not exported from ...
I was building a react project but when I tried to run it. It showed the following error: Module not found: Error: Package...
Read more >
Export and import data | Firestore - Firebase
Export data. An export operation copies documents in your database to a set of files in a Cloud Storage bucket. Note that an...
Read more >
Package exports - webpack
js files for "package" and the file system lookup for "package/sub/path" . When the exports field is specified, only these module requests are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found