canirequire › Dual (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.
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.
| Runtime | require("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.4 | pending | pending |
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).
| Versions | Format | First published |
|---|---|---|
| 10.7.2 – 12.18.0 | Dual (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
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- js-beautify 2.0.3CommonJS
- webpack-node-externals 3.0.0CommonJS
- styled-components 6.5.3CommonJS
- polished 4.3.1CommonJS
- @babel/plugin-proposal-nullish-coalescing-operator 7.18.6CommonJS
- @commitlint/config-conventional 21.2.2ESM-only
- xlsx 0.18.5CommonJS
- update-notifier 7.3.1ESM-only