canirequire › CommonJS › karma-phantomjs-launcher
Is karma-phantomjs-launcher ESM-only? Can you require() it?
A Karma plugin. Launcher for PhantomJS.
Last verified Sep 9, 2026 against karma-phantomjs-launcher@1.0.4. JSON
CommonJS CommonJS — require() works on every Node.js version
karma-phantomjs-launcher ships CommonJS only. require("karma-phantomjs-launcher") works everywhere. import "karma-phantomjs-launcher" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
Deprecated: PhantomJS development have stopped, use puppeteer or similar
Does karma-phantomjs-launcher@1.0.4 actually load? Runtime test results
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 | ✗ failsERR_INVALID_ARG_TYPE | ✗ failsERR_INVALID_ARG_TYPE |
| Node.js 20 | ✗ failsERR_INVALID_ARG_TYPE | ✗ failsERR_INVALID_ARG_TYPE |
| Node.js 22 | ✗ failsERR_INVALID_ARG_TYPE | ✗ failsERR_INVALID_ARG_TYPE |
| Node.js 24 | ✗ failsERR_INVALID_ARG_TYPE | ✗ failsERR_INVALID_ARG_TYPE |
| Node.js 26 | ✗ failsERR_INVALID_ARG_TYPE | ✗ failsERR_INVALID_ARG_TYPE |
| Bun 1.4 | ✗ failsERR_INVALID_ARG_TYPE | ✗ failsERR_INVALID_ARG_TYPE |
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 karma-phantomjs-launcher
ES modules (import)
import karmaPhantomjsLauncher from "karma-phantomjs-launcher";Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.
CommonJS (require)
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 is a CommonJS package. karma-phantomjs-launcher ships CommonJS only. require("karma-phantomjs-launcher") works everywhere. import "karma-phantomjs-launcher" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
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 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
Other commonjs packages
- debug 4.4.3CommonJS
- semver 7.8.5CommonJS
- ms 2.1.3CommonJS
- picomatch 4.0.7CommonJS
- ajv 8.20.0CommonJS
- source-map 0.8.0CommonJS
- react-is 19.2.8CommonJS
- readable-stream 4.7.0CommonJS
Similar popularity
- ember-load-initializers 3.0.1ESM-only
- @react-native-community/eslint-config 3.2.0CommonJS
- gulp-mocha 10.0.1ESM-only
- load-grunt-tasks 5.1.0CommonJS
- broccoli-asset-rev 3.0.0CommonJS
- ember-cli-inject-live-reload 2.1.0CommonJS
- babel 6.23.0CommonJS
- @vue/cli-plugin-typescript 5.0.9CommonJS