canirequire › Dual (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.
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.
| Runtime | require("@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).
| Versions | Format | First published |
|---|---|---|
| 2.47.1 – 2.70.3 | Dual (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
- 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
- @semantic-release/github 12.0.9ESM-only
- @storybook/react-webpack5 10.6.0No entry
- @angular/cli 22.1.7CommonJS
- @ethersproject/address 5.8.0CommonJS
- @angular/material 22.1.6No entry
- @angular/cdk 22.1.6No entry
- @angular/animations 22.1.5ESM-only
- @ethersproject/networks 5.8.0CommonJS