Shakapacker 9.0.0-beta.5 npm package is published with TypeScript source files (.ts) but missing the compiled JavaScript files (.js), making the package unusable.
When trying to use shakapacker 9.0.0-beta.5, webpack fails with:
Error: Cannot find module '/path/to/node_modules/shakapacker/package/index.js'
The npm package contains only TypeScript source files without the compiled JavaScript output.
Beta.4 package structure (working):
$ ls -la node_modules/shakapacker/package/
-rw-r--r-- config.js # ✅ JavaScript file exists
-rw-r--r-- dev_server.js # ✅ JavaScript file exists
-rw-r--r-- env.js # ✅ JavaScript file exists
-rw-r--r-- index.js # ✅ JavaScript file exists
-rw-r--r-- index.d.ts # TypeScript definitionsBeta.5 package structure (broken):
$ ls -la node_modules/shakapacker/package/
-rw-r--r-- config.ts # ❌ TypeScript source only
-rw-r--r-- dev_server.ts # ❌ TypeScript source only
-rw-r--r-- env.ts # ❌ TypeScript source only
-rw-r--r-- index.ts # ❌ TypeScript source only
-rw-r--r-- index.d.ts # TypeScript definitions
# Missing: index.js, config.js, dev_server.js, env.js{
"scripts": {
"build": "tsc",
// ...
}
}But the tsconfig.json is not included in the published package, and the build output is missing.
The build process needs to:
- Run
npm run buildbefore publishing to compile TypeScript to JavaScript - Ensure the compiled .js files are included in the npm package
- Update the package.json "files" field or .npmignore to include the compiled output
For now, users should use:
- 9.0.0-beta.4 which has the compiled JavaScript files
- Set
javascript_transpiler: babelin shakapacker.yml (beta.4 defaults to SWC)
| Version | Status | Notes |
|---|---|---|
| 8.2.0 | ✅ Working | Stable release |
| 8.4.0 | ✅ Working | Latest stable |
| 9.0.0-beta.4 | ✅ Working | Has compiled JS, defaults to SWC |
| 9.0.0-beta.5 | ❌ Broken | Missing compiled JS files |
When using beta.4, add to config/shakapacker.yml:
default: &default
javascript_transpiler: babel # Beta versions default to SWC