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

Unable to load preload script after upgrade electron-forge@6.4.2 #3343

Closed
3 tasks done
TianbinTobin opened this issue Sep 9, 2023 · 6 comments · Fixed by #3353
Closed
3 tasks done

Unable to load preload script after upgrade electron-forge@6.4.2 #3343

TianbinTobin opened this issue Sep 9, 2023 · 6 comments · Fixed by #3353
Assignees
Labels
bug plugin/webpack Issues or pull requests related to first-party webpack plugins/templates

Comments

@TianbinTobin
Copy link

TianbinTobin commented Sep 9, 2023

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

6.4.2

Electron version

v26.2.0

Operating system

Windows 10.0.22631 x64

Last known working Electron Forge version

6.4.1

Expected behavior

main_window/preload.js and main_view/preload.js load success when i run electron-forge start.

Actual behavior

main_window/preload.js load success but main_view/preload.js load failed when i run electron-forge start util i reload the main_view.
image

Steps to reproduce

new WebpackPlugin({
      devServer: {
        // Disallow browser from opening/reloading with HMR in development mode.
        hot: 'only',
        open: false,
        liveReload: false,
      },
      mainConfig,
      renderer: {
        config: rendererConfig,
        entryPoints: [
          {
            name: 'main_window',
            html: './static/index.html',
            js: './src/renderer/renderer.ts',
            preload: {
              js: './src/preload/main-window.ts',
            },
          },
          {
            name: 'main_view',
            preload: {
              js: './src/preload/main-view.ts',
            },
          },
        ],
      },
    }),

Additional information

https://github.com/TianbinTobin/electron-forge-issues-3343.git
Version 6.4.1 it works fine

@caoxiemeihao
Copy link
Member

Can you provide a minimal reproduction repo?
Looks like need to login?

image

@erickzhao erickzhao added plugin/webpack Issues or pull requests related to first-party webpack plugins/templates bug labels Sep 11, 2023
@erickzhao
Copy link
Member

Might be related to #3101

@georgexu99
Copy link
Contributor

Thank you for the high-quality issue report, we really appreciate the repro example :)

I cloned the repo but was unable to observe the error after a yarn and yarn start- the url loads as expected, can you say more? Otherwise I'll close this issue out in a day or two :)

@georgexu99 georgexu99 added the blocked/needs-info Issues lacking information for resolution label Sep 11, 2023
@mariosplen
Copy link

The same error shows up briefly to me as well.

I simply followed the instructions to create an Electron app with React and Electron Forge from here: https://www.electronforge.io/guides/framework-integration/react.

The error starts showing when the BrowserWindow loads, and it stops showing when the HTML has loaded.

I'm using windows and npm (if that makes any difference)

Downgrading to 6.4.1 doesn't display any error.

@anwebdevelopers
Copy link

anwebdevelopers commented Sep 12, 2023

The same issue.. Downgrading to 6.4.1 works fine.
image

@georgexu99 georgexu99 removed the blocked/needs-info Issues lacking information for resolution label Sep 12, 2023
@georgexu99
Copy link
Contributor

A fix is being worked on, thank you for your patience 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plugin/webpack Issues or pull requests related to first-party webpack plugins/templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants