canirequire

canirequireDual (CommonJS + ESM) › @sveltejs/kit

Is @sveltejs/kit ESM-only? Can you require() it?

SvelteKit is the fastest way to build Svelte apps

Last verified Sep 9, 2026 against @sveltejs/kit@2.70.3. JSON

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

@sveltejs/kit publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("@sveltejs/kit") and import "@sveltejs/kit" both work on every supported Node.js version and in Bun.

Latest
2.70.3 (Aug 18, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
2.70.3
Native ESM since
1.0.0
TypeScript types
Bundled
Node engines
>=18.13
License
MIT

Does @sveltejs/kit@2.70.3 actually load? Runtime test results

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

Runtimerequire("@sveltejs/kit")import "@sveltejs/kit"
Node.js 18✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 20✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 22✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 24✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 26✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Bun 1.4✗ failserror: Cannot find module '@sveltejs/kit' from '/Users/boat/Projects/top-seo/data/probe-work/@sveltejs__kit/req.cjs'✓ works

A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.

How to import @sveltejs/kit

ES modules (import)

import kit from "@sveltejs/kit";

CommonJS (require)

const kit = require("@sveltejs/kit");

Module format by version

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

VersionsFormatFirst published
2.47.1 – 2.70.3Dual (CommonJS + ESM)Oct 17, 2025

Frequently asked

Is @sveltejs/kit ESM-only?

@sveltejs/kit@2.70.3 ships CommonJS and ESM builds. @sveltejs/kit publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("@sveltejs/kit") and import "@sveltejs/kit" both work on every supported Node.js version and in Bun.

Can I require @sveltejs/kit?

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

Does @sveltejs/kit work in Bun?

Yes. import "@sveltejs/kit" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does @sveltejs/kit ship TypeScript types?

Yes. @sveltejs/kit bundles its own type declarations; no @types package is needed.

Links

Other dual (commonjs + esm) packages

Similar popularity