canirequire

canirequireDual (CommonJS + ESM) › firebase

Is firebase ESM-only? Can you require() it?

Firebase JavaScript library for web and Node.js

Latest version 12.18.0, published Aug 19, 2026. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

firebase publishes both a CommonJS entry and a native ESM entry (ESM added in 9.0.0). require("firebase") and import "firebase" both work on every supported Node.js version and in Bun.

Latest
12.18.0 (Aug 19, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
12.18.0
Native ESM since
9.0.0
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
9.1M
License
Apache-2.0

Does firebase@12.18.0 actually load? Runtime test results

Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.

Runtimerequire("firebase")import "firebase"
Node.js 18✓ expected✓ expected
Node.js 20✓ expected✓ expected
Node.js 22✓ expected✓ expected
Node.js 24✓ expected✓ expected
Node.js 26✓ expected✓ expected
Bun 1.4pendingpending

Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.

How to import firebase

ES modules (import)

import firebase from "firebase";

CommonJS (require)

const firebase = require("firebase");

Module format by version

Derived from the type, main and exports fields of every stable release on npm (473 versions; the newest 60 shown).

VersionsFormatFirst published
10.7.2 – 12.18.0Dual (CommonJS + ESM)Jan 18, 2024

Frequently asked

Is firebase ESM-only?

firebase@12.18.0 ships CommonJS and ESM builds. firebase publishes both a CommonJS entry and a native ESM entry (ESM added in 9.0.0). require("firebase") and import "firebase" both work on every supported Node.js version and in Bun.

Can I require firebase?

Yes. firebase ships a CommonJS entry, so require("firebase") works on every Node.js version, alongside the native ESM entry for import.

Does firebase ship TypeScript types?

Yes. firebase bundles its own type declarations; no @types package is needed.

Links

Other dual (commonjs + esm) packages

Similar popularity