Works in dev but errors in prod
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- electron, typescript, vite
- Domain
- build-system
Research direction
Clone the linked reproduction repository and first verify that npm start works while electron-forge make produces a packaged app that fails with Cannot find module 'sharp'. Compare the Vite development setup with the packaged output under out/make and review the related issues #1276 and #1250. Done means the packaged macOS application launches successfully with sharp available.
Written by the indexing model from the issue text.
Description
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Forge version
7.8.0
Electron version
35.1.2
Operating system
macOs 15.3.2 (24D81)
Last known working Forge version
No response
Expected behavior
When I build my app, it should work like it does in dev
Actual behavior
When I build the app using electron-forge make and run the final binary at out/make/electron-forge-help-1.0.0-arm64.dmg, it errors out on startuo with "Cannot find module 'sharp'":
Steps to reproduce
- clone the reproduction repo https://github.com/damms005/electron-forge-help
- install deps and
npm startand confirm it works - build with
npm run makeand run the executable in./out/make/... - you should get error similar to screenshot provided
Additional information
It seems #1276 and #1250 have same issues, but they are webpack-based and I am unable to transfer my understanding of them to this vite-based project
- Dominant language
- TypeScript
- Stars
- 7.1k
- Forks
- 642
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 35
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from electron/forge
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·