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

> @sveltejs/kit@2.70.3 is ESM-only. ESM-only — it has never shipped a CommonJS build.

SvelteKit is the fastest way to build Svelte apps

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

@sveltejs/kit has been ESM-only since its first stable release; there is no CommonJS version to pin.

require("@sveltejs/kit") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. On Node.js 18, which has no require(esm), require("@sveltejs/kit") fails with ERR_REQUIRE_ESM.

## What to do

1. require("@sveltejs/kit") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it.
2. From a CommonJS file, use a dynamic import inside an async function: const kit = await import("@sveltejs/kit"). That works on every Node.js version the package supports (>=18.13).
3. There is no CommonJS release of @sveltejs/kit to pin; without require(esm) the only option is a dynamic import().
4. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 2.70.3 (Aug 18, 2026)
- Module format: ESM-only
- Last CommonJS version: none
- ESM-only since: 1.0.0 (Dec 14, 2022)
- TypeScript types: bundled
- Node engines: >=18.13
- Weekly downloads: 2.0M
- License: MIT

## Runtime test results for @sveltejs/kit@2.70.3

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 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | works |
| Node.js 20 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | works |
| Node.js 22 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | works |
| Node.js 24 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | works |
| Node.js 26 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | works |
| Bun 1.4.0 | fails (Error) | works |

## How to import @sveltejs/kit

ES modules:

```js
import * as kit from "@sveltejs/kit";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

```js
// require("@sveltejs/kit") failed in our probe on Node.js 20.19+, 22.12+ and newer as well (ERR_PACKAGE_PATH_NOT_EXPORTED); see the runtime table.

// Any Node.js version the package supports (>=18.13), from an async function:
async function main() {
  const kit = await import("@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 | ESM-only | Oct 17, 2025 |

## Frequently asked

**Is @sveltejs/kit ESM-only?**

@sveltejs/kit@2.70.3 is ESM-only. @sveltejs/kit has been ESM-only since its first stable release; there is no CommonJS version to pin.

**Which version of @sveltejs/kit still supports CommonJS / require()?**

None. @sveltejs/kit has always been ESM-only. Use import, or a dynamic import("@sveltejs/kit") from an async function in CommonJS.

**How do I use @sveltejs/kit from a CommonJS file?**

From a CommonJS file, use a dynamic import inside an async function: const kit = await import("@sveltejs/kit"). That works on every Node.js version the package supports (>=18.13). require("@sveltejs/kit") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it.

**Does @sveltejs/kit work in Bun?**

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

**Does @sveltejs/kit ship TypeScript types?**

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

## Links

- [@sveltejs/kit on npm](https://www.npmjs.com/package/@sveltejs/kit)
- [Source repository](https://github.com/sveltejs/kit)
- [HTML version](https://canirequire.com/package/@sveltejs/kit/)
- [JSON version](https://canirequire.com/package/@sveltejs/kit.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
