canirequire

canirequireESM-only › lit

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

A library for building fast, lightweight web components

Last verified Sep 9, 2026 against lit@3.3.3. JSON

ESM-only ESM-only since 2.0.0 — last CommonJS version is 1.0.1

lit dropped its CommonJS build in 2.0.0 (September 2021). The last version you can require() on every Node.js version, including 18 and older, is 1.0.1, published Jul 5, 2012.

On Node.js 20.19+, 22.12+ and every newer release, require("lit") works anyway: Node can load synchronous ES modules through require(). Verified on Node 20, 22, 24, 26. Node.js 18 and older still fail with ERR_REQUIRE_ESM.

Latest
3.3.3 (May 14, 2026)
Module format
ESM-only
Last CommonJS version
1.0.1
ESM-only since
2.0.0 (Sep 21, 2021)
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
6.3M
License
BSD-3-Clause

Does lit@3.3.3 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("lit") from a CommonJS file and import "lit" from an ES module.

Runtimerequire("lit")import "lit"
Node.js 18✗ failsERR_REQUIRE_ESM✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import lit

ES modules (import)

import lit from "lit";

CommonJS (require)

// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const lit = require("lit");

// Any Node.js version:
const lit = await import("lit");

// Or pin the last CommonJS release:
// npm install lit@1.0.1

Module format by version

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

VersionsFormatFirst published
2.0.0 – 3.3.3ESM-onlySep 21, 2021
1.0.0 – 1.0.1CommonJSJul 4, 2012

Frequently asked

Is lit ESM-only?

lit@3.3.3 is ESM-only. lit dropped its CommonJS build in 2.0.0 (September 2021). The last version you can require() on every Node.js version, including 18 and older, is 1.0.1, published Jul 5, 2012.

Which version of lit still supports CommonJS / require()?

1.0.1 is the last version of lit with a CommonJS build. Install it with "npm install lit@1.0.1". Every version from 2.0.0 on is ESM-only.

How do I use lit from a CommonJS file?

Use a dynamic import: const mod = await import("lit"). On Node.js 20.19+, 22.12+ and newer, a plain require("lit") also works for ESM packages that do not use top-level await. Alternatively pin lit@1.0.1.

Does lit work in Bun?

Yes. import "lit" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does lit ship TypeScript types?

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

Links

Other esm-only packages

Similar popularity