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

fix(template-typescript-webpack): properly load forge.config.ts #3016

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Oct 28, 2022

Issue

Our usage of rechoir introduced in #2993 was actually broken. Running the TypeScript Webpack template yields the following error when attempting to load forge.config.ts with rechoir.

An unhandled rejection has occurred inside Forge:
Error: Unable to use specified module loaders for ".ts".

Electron Forge was terminated. Location:
{}
error Command failed with exit code 1.

Repro

Run the init command with --template=typescript-webpack and attempt to run yarn start.

Solution

Add ts-node as a dev dependency for the template.

Rationale

As per the rechoir docs, rechoir needs a local installation of the ts -> js transformer to run.

Note
While rechoir will automatically load and register transpilers like coffee-script, you must provide a local installation. The transpilers are not bundled with this module.

A similar error was filed for rechoir usage in the webpack CLI in the past (webpack/webpack-cli#1993) where the solution was to install ts-node.

@erickzhao erickzhao changed the title fix(template-typescript-webpack): install ts-node fix(template-typescript-webpack): properly load forge.config.ts Oct 28, 2022
"node-loader": "^2.0.0",
"style-loader": "^3.0.0",
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line this the only change. The rest of the diff is alphabetization.

@VerteDinde VerteDinde merged commit ab160d5 into main Oct 28, 2022
@VerteDinde VerteDinde deleted the fix/rechoir branch October 28, 2022 21:57
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

Successfully merging this pull request may close these issues.

2 participants