Vue-cli-plugin-electron-builder: GET http://localhost:8080/js/about.js net::ERR_INVALID_ARGUMENT

Created on 12 Nov 2019  路  4Comments  路  Source: nklayman/vue-cli-plugin-electron-builder

Describe the bug
after updating all packages and starting it with "npm run electron:serve", devtools/console displays the error "GET http://localhost:8080/js/about.js net::ERR_INVALID_ARGUMENT".

To Reproduce

  • vue create app-test
  • select "router" and "vuex" in settings
  • vue add electron-builder
  • update all packages (best way with ncu)

Expected behavior
all routes with lazy loading display the error

Screenshots
If applicable, add screenshots to help explain your problem.
grafik

Environment (please complete the following information):

  • OS and version: Win10 Build 1809
  • node version: v10.16.3
  • npm version: 6.9.0
  • vue-cli-plugin-electron-builder version :
  • electron version: 7.1.1
  • other vue plugins used:
    "@vue/cli-plugin-babel": "^4.0.5",
    "@vue/cli-plugin-eslint": "^4.0.5",
    "@vue/cli-plugin-router": "^4.0.5",
    "@vue/cli-plugin-vuex": "^4.0.5",
    "@vue/cli-service": "^4.0.5",
    "@vue/eslint-config-standard": "^4.0.0",
    "vue-template-compiler": "^2.6.10"

Additional context
Add any other context about the problem here.

Most helpful comment

The error is thrown by the prefetch script, the actual script is requested fine. In v2 prefetching will be disabled in development with electron v7+, for now set your vue.config.js to:

module.exports = {
  pluginOptions: {
    electronBuilder: {
      chainWebpackRendererProcess: config => {
        if (process.env.NODE_ENV === 'development') {
          config.plugins.delete('prefetch')
        }
      }
    }
  }
}

All 4 comments

It seems like you delete the About.vue manualy.
Try run npm run electron:build to rebuild the vue project.

Hi xland, you are right with "npm run electron:build" the error is not displayed. I don't understand why, in dev mode I use the normal template which is given by the CLI and don't change anything. What do I have to change?

edit: and interessting info, with electron 6.X.X it doesn't display the error, only with electron 7.X.X.

This plugin is not ready for electron 7.X.X
see #540 .

The error is thrown by the prefetch script, the actual script is requested fine. In v2 prefetching will be disabled in development with electron v7+, for now set your vue.config.js to:

module.exports = {
  pluginOptions: {
    electronBuilder: {
      chainWebpackRendererProcess: config => {
        if (process.env.NODE_ENV === 'development') {
          config.plugins.delete('prefetch')
        }
      }
    }
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

wakamin picture wakamin  路  3Comments

HarlanGitHub picture HarlanGitHub  路  4Comments

thislooksfun picture thislooksfun  路  6Comments

grantdfoster picture grantdfoster  路  3Comments

iamazik picture iamazik  路  5Comments