-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The brainstorming visual companion server fails to start on Node.js v25+ with:
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and
'.../superpowers/5.0.4/package.json' contains "type": "module".
Root Cause
skills/brainstorming/scripts/server.js uses CommonJS (require()), but the root package.json declares "type": "module". Node.js v25 enforces this strictly — all .js files under a "type": "module" package are treated as ESM, causing require() to throw.
Steps to Reproduce
- Have Node.js v25+ installed
- Start a brainstorming session that triggers the visual companion
- Server fails with the error above
Fix
Rename server.js → server.cjs and update the two node server.js invocations in start-server.sh to node server.cjs. The .cjs extension forces CommonJS mode regardless of the package.json type field.
Alternatively, the server script could be rewritten to use ESM imports.
Environment
- Node.js: v25.8.1
- Superpowers: v5.0.4
- Platform: macOS (Darwin 25.3.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working