Skip to content
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

Electron Forge webpack template does not include webpack support #3781

Closed
3 tasks done
lunaDHD opened this issue Dec 10, 2024 · 3 comments
Closed
3 tasks done

Electron Forge webpack template does not include webpack support #3781

lunaDHD opened this issue Dec 10, 2024 · 3 comments

Comments

@lunaDHD
Copy link

lunaDHD commented Dec 10, 2024

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.

Electron Forge version

latest

Electron version

latest

Operating system

windows 11

Last known working Electron Forge version

unknown

Expected behavior

Running npm init electron-app@latest my-new-app -- --template=webpack properly creates a electron-forge project with webpack compatibility.

Actual behavior

Running npm init electron-app@latest my-new-app -- --template=webpack creates a electron-forge project without webpack compatibilty, and without several required files. Following is an image of file explorer with the created directory. The command was working as soon as 3 days ago however it recently broke for an unknown reason
from "my-new-app" directory
Image
"my-new-app/src"
Image

Steps to reproduce

create a webpack template. I literally have no idea if this is a recent change or me being dumb but it looks nothing like the other electron-forge project I have been working on this week.

Additional information

The command used is directly from the electron-forge website under "built-in-templates" in "webpack". Downloading the template even shows an error after running npm start. that being:

Uncaught Exception:
(Index.js path):1
import {app, BrowserWindow} from 'electron'
^^^^
Syntax Error: Cannot use import statement outside module.

I took this as more evidence something is wrong rather than another error in itself given that it has a pretty simple fix. That being adding a "type" : "module", line after "productName" in the package.json.

@lunaDHD
Copy link
Author

lunaDHD commented Dec 10, 2024

I'm sorry if there's something wrong with this but I don't have much experience with JavaScript or large complicated projects like this. And most of my coding experience is with small python projects. I just want to learn a front-end framework for desktop and move on with my life.
PS: sorry for the weird formatting i'm a bit new to markdown.

@erickzhao
Copy link
Member

If you're on Windows, this might be an issue with the npm CLI on Windows: #3662

@lunaDHD lunaDHD closed this as completed Dec 11, 2024
@lunaDHD
Copy link
Author

lunaDHD commented Dec 11, 2024

This issue is an accidental duplicate of #3662 due to a strange name. My bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants