canirequire

canirequire › ESM-only › @vueuse/core

Is @vueuse/core ESM-only? Can you require() it?

Collection of essential Vue Composition Utilities

Last verified Sep 9, 2026 against @vueuse/core@14.4.0. Markdown · JSON

ESM-only ESM-only since 13.0.0 — last CommonJS version is 12.8.2

@vueuse/core dropped its CommonJS build in 13.0.0 (March 2025). The last version with a plain require()-able CommonJS entry is 12.8.2, published Mar 5, 2025.

On Node.js 20.19+, 22.12+ and newer, require("@vueuse/core") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26. On Node.js 18, which has no require(esm), require("@vueuse/core") fails with ERR_REQUIRE_ESM.

What to do

  1. On Node.js 20.19+, 22.12+ and newer, require("@vueuse/core") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26.
  2. From a CommonJS file, use a dynamic import inside an async function: const core = await import("@vueuse/core"). That works on every Node.js version the package supports.
  3. If you need a synchronous require() or run Node.js 18: npm install @vueuse/core@12.8.2, the last CommonJS release (published Mar 5, 2025).
  4. TypeScript: types are bundled; install nothing extra.
Latest
14.4.0 (Jul 29, 2026)
Module format
ESM-only
Last CommonJS version
12.8.2
ESM-only since
13.0.0 (Mar 10, 2025)
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
8.1M
License
MIT

Does @vueuse/core@14.4.0 actually load? Runtime test results

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

Runtimerequire("@vueuse/core")import "@vueuse/core"
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.0✓ works✓ works

How to import @vueuse/core

ES modules (import)

import * as core from "@vueuse/core";

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

CommonJS (require)

// Node.js 20.19+, 22.12+ and newer (verified):
const core = require("@vueuse/core");

// Any Node.js version the package supports, from an async function:
async function main() {
  const core = await import("@vueuse/core");
}

// Or pin the last CommonJS release:
// npm install @vueuse/core@12.8.2

Module format by version

Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (271 versions; the newest 60 shown).

VersionsFormatFirst published
13.0.0 – 14.4.0ESM-onlyMar 10, 2025
9.11.0 – 12.8.2Dual (CommonJS + ESM)Jan 17, 2023

Frequently asked

Is @vueuse/core ESM-only?

@vueuse/core@14.4.0 is ESM-only. @vueuse/core dropped its CommonJS build in 13.0.0 (March 2025). The last version with a plain require()-able CommonJS entry is 12.8.2, published Mar 5, 2025.

Which version of @vueuse/core still supports CommonJS / require()?

12.8.2 is the last version of @vueuse/core with a CommonJS build. Install it with "npm install @vueuse/core@12.8.2". Every version from 13.0.0 on is ESM-only.

How do I use @vueuse/core from a CommonJS file?

From a CommonJS file, use a dynamic import inside an async function: const core = await import("@vueuse/core"). That works on every Node.js version the package supports. On Node.js 20.19+, 22.12+ and newer, require("@vueuse/core") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26. Alternatively pin @vueuse/core@12.8.2.

Does @vueuse/core work in Bun?

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

Does @vueuse/core ship TypeScript types?

Yes. @vueuse/core bundles its own type declarations; no @types package is needed.

Links

Other esm-only packages

Similar popularity