-
Notifications
You must be signed in to change notification settings - Fork 380
Investigation: Shakapacker 9.0.0-beta.5 npm package issue #661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Shakapacker 9.0.0-beta.5 Missing Compiled JavaScript Files | ||
|
||
## Issue Summary | ||
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. | ||
|
||
## Details | ||
|
||
### What's happening: | ||
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' | ||
``` | ||
|
||
### Root Cause: | ||
The npm package contains only TypeScript source files without the compiled JavaScript output. | ||
|
||
### Investigation Results: | ||
|
||
**Beta.4 package structure (working):** | ||
```bash | ||
$ 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 definitions | ||
``` | ||
|
||
**Beta.5 package structure (broken):** | ||
```bash | ||
$ 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 | ||
``` | ||
|
||
### Package.json has build script: | ||
```json | ||
{ | ||
"scripts": { | ||
"build": "tsc", | ||
// ... | ||
} | ||
} | ||
``` | ||
|
||
But the tsconfig.json is not included in the published package, and the build output is missing. | ||
|
||
## Likely Fix Needed | ||
|
||
The build process needs to: | ||
1. Run `npm run build` before publishing to compile TypeScript to JavaScript | ||
2. Ensure the compiled .js files are included in the npm package | ||
3. Update the package.json "files" field or .npmignore to include the compiled output | ||
|
||
## Workaround | ||
|
||
For now, users should use: | ||
- **9.0.0-beta.4** which has the compiled JavaScript files | ||
- Set `javascript_transpiler: babel` in shakapacker.yml (beta.4 defaults to SWC) | ||
|
||
## Version Comparison | ||
|
||
| 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 | | ||
|
||
## Configuration Change for Beta.4 | ||
|
||
When using beta.4, add to `config/shakapacker.yml`: | ||
```yaml | ||
default: &default | ||
javascript_transpiler: babel # Beta versions default to SWC | ||
``` |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -93,7 +93,7 @@ | |||||
"sass": "^1.58.3", | ||||||
"sass-loader": "^13.3.2", | ||||||
"sass-resources-loader": "^2.2.5", | ||||||
"shakapacker": "8.2.0", | ||||||
"shakapacker": "9.0.0-beta.5", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep npm on beta.4 until beta.5 is republished with JS builds. Line 96 updates npm to - "shakapacker": "9.0.0-beta.5",
+ "shakapacker": "9.0.0-beta.4", 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
"stimulus": "^3.0.1", | ||||||
"style-loader": "^3.3.1", | ||||||
"tailwindcss": "^3.3.3", | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not upgrade to beta.5—it ships without compiled JS output.
Line 9 pulls in shakapacker 9.0.0.beta.5, but the investigation doc in this PR shows that beta.5 is published without any compiled
.js
files, so webpack fails with “Cannot find module ‘…/shakapacker/package/index.js’.” Shipping this version will break every build. Please stick to 9.0.0-beta.4 (or 8.x) until beta.5 is republished with the compiled output.Apply this diff to keep the project working:
📝 Committable suggestion
🤖 Prompt for AI Agents