# Is karma-phantomjs-launcher ESM-only? Can you require() it?

> karma-phantomjs-launcher@1.0.4 declares a CommonJS entry, but require() fails at runtime. CommonJS on paper — require() failed in our runtime test.

A Karma plugin. Launcher for PhantomJS.

Last verified Sep 9, 2026 against karma-phantomjs-launcher@1.0.4.

karma-phantomjs-launcher declares a CommonJS entry only, but require("karma-phantomjs-launcher") failed on every Node.js version in our probe: ERR_INVALID_ARG_TYPE. import "karma-phantomjs-launcher" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.

**Deprecated:** PhantomJS development have stopped, use puppeteer or similar

## What to do

1. require("karma-phantomjs-launcher") failed in our probe on every Node.js version (ERR_INVALID_ARG_TYPE); check the package README for peer dependencies or setup before relying on it.
2. From ES modules use the default import: import karmaPhantomjsLauncher from "karma-phantomjs-launcher"; then destructure. Named imports only work when Node.js can statically detect the exports.
3. TypeScript: no types are available for karma-phantomjs-launcher; declare the module yourself if you need them.
4. This package is deprecated: PhantomJS development have stopped, use puppeteer or similar

## Facts

- Latest: 1.0.4 (Mar 10, 2017)
- Module format: CommonJS
- Last CommonJS version: 1.0.4
- TypeScript types: none
- Node engines: not declared
- Weekly downloads: 177K
- License: MIT

## Runtime test results for karma-phantomjs-launcher@1.0.4

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

| Runtime | require("karma-phantomjs-launcher") | import "karma-phantomjs-launcher" |
|---|---|---|
| Node.js 18 | fails (ERR_INVALID_ARG_TYPE) | fails (ERR_INVALID_ARG_TYPE) |
| Node.js 20 | fails (ERR_INVALID_ARG_TYPE) | fails (ERR_INVALID_ARG_TYPE) |
| Node.js 22 | fails (ERR_INVALID_ARG_TYPE) | fails (ERR_INVALID_ARG_TYPE) |
| Node.js 24 | fails (ERR_INVALID_ARG_TYPE) | fails (ERR_INVALID_ARG_TYPE) |
| Node.js 26 | fails (ERR_INVALID_ARG_TYPE) | fails (ERR_INVALID_ARG_TYPE) |
| Bun 1.4.0 | fails (ERR_INVALID_ARG_TYPE) | fails (ERR_INVALID_ARG_TYPE) |

## How to import karma-phantomjs-launcher

ES modules:

```js
import karmaPhantomjsLauncher from "karma-phantomjs-launcher";
```

CommonJS:

```js
// require("karma-phantomjs-launcher") failed in our probe on every Node.js version we test (ERR_INVALID_ARG_TYPE); see the runtime table.
const karmaPhantomjsLauncher = require("karma-phantomjs-launcher");
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 0.0.1 – 1.0.4 | CommonJS | Mar 19, 2013 |

## Frequently asked

**Is karma-phantomjs-launcher ESM-only?**

karma-phantomjs-launcher@1.0.4 declares a CommonJS entry, but require() fails at runtime. karma-phantomjs-launcher declares a CommonJS entry only, but require("karma-phantomjs-launcher") failed on every Node.js version in our probe: ERR_INVALID_ARG_TYPE. import "karma-phantomjs-launcher" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.

**Can I require karma-phantomjs-launcher?**

Not in practice. karma-phantomjs-launcher declares a CommonJS entry, but require("karma-phantomjs-launcher") failed on every Node.js version in our probe: ERR_INVALID_ARG_TYPE. Check the package README for peer dependencies or setup before relying on it.

**Can I import karma-phantomjs-launcher with ES module syntax?**

Yes. import karmaPhantomjsLauncher from "karma-phantomjs-launcher" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

**Does karma-phantomjs-launcher work in Bun?**

Importing karma-phantomjs-launcher failed in Bun 1.4.0 on Sep 9, 2026: TypeError: The "path" property must be of type string, got object

**Does karma-phantomjs-launcher ship TypeScript types?**

No. karma-phantomjs-launcher ships no type declarations and there is no @types package for it.

## Links

- [karma-phantomjs-launcher on npm](https://www.npmjs.com/package/karma-phantomjs-launcher)
- [Source repository](https://github.com/karma-runner/karma-phantomjs-launcher)
- [HTML version](https://canirequire.com/package/karma-phantomjs-launcher/)
- [JSON version](https://canirequire.com/package/karma-phantomjs-launcher.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.
