question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid options object when running `electron-forge start`

See original GitHub issue

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version:
    • 6.0.0-beta.55
  • Electron Version:
    • 11.4.1
  • Operating System:
    • Windows 10
  • Last Known Working Electron Forge version::
    • 6.0.0-beta.54

Expected Behavior

Running the Electron app in dev mode should work.

Actual Behavior

When running electron-forge start it prints the following output:

√ Checking your system
√ Locating Application
√ Preparing native dependencies: 1 / 1
√ Compiling Main Process Code
× Launch Dev Servers

An unhandled error has occurred inside Forge:
Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'historyApiFallback'. These properties are valid:
   object { mimeTypes?, writeToDisk?, methods?, headers?, publicPath?, stats?, serverSideRender?, outputFileSystem?, index? }
ValidationError: Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'historyApiFallback'. These properties are valid:
   object { mimeTypes?, writeToDisk?, methods?, headers?, publicPath?, stats?, serverSideRender?, outputFileSystem?, index? }
    at validate (<project-path>\electron\node_modules\webpack-dev-middleware\node_modules\schema-utils\dist\validate.js:104:11)
    at wdm (<project-path>\electron\node_modules\webpack-dev-middleware\dist\index.js:29:29)
    at <project-path>\electron\node_modules\@electron-forge\plugin-webpack\src\WebpackPlugin.ts:292:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

I updated electron-forge from 6.0.0-beta.54 to 6.0.0-beta.55 and did not change any configuration.

To Reproduce

Additional Information

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Xananaxcommented, May 18, 2021

Edit the generated package.json and change the version of

"@electron-forge/plugin-webpack": "6.0.0-beta.54",

to .54 instead of .55.

I believe the faulty change is here: https://github.com/electron-userland/electron-forge/commit/790647dc7314eac40735f8d67ba831a8991d4bd4

1reaction
jhofercommented, May 18, 2021

I have the same issue when creating a new app using the webpack-typescript template: https://www.electronforge.io/templates/typescript-+-webpack-template

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid options object when running electron-forge start #2273
I have searched the issue tracker for a bug that matches the one I want to file, without success. Issue Details. Electron Forge...
Read more >
Invalid options object. Dev Server has been initialized using ...
Here is a workaround. Delete "proxy": "http://localhost:6000". Install package http-proxy-middleware with command npm install ...
Read more >
validationerror: invalid options object. dev ... - You.com
Dev Middleware has been initialized using an options object that does not match the ... When running electron-forge start it prints the following...
Read more >
Electron Forge: Getting Started
Quickly scaffold an Electron project with a full build pipeline.
Read more >
Breaking Changes - Electron.js
Beginning in Electron 20, renderers will be sandboxed by default, ... in window features will now present as keys with the value true...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found