Electron-vue: blank screen on build

Created on 24 Jun 2018  路  3Comments  路  Source: SimulatedGREG/electron-vue

Something related to https://github.com/SimulatedGREG/electron-vue/issues/457

I'm building my app with electron-builder.
yarn dev works fine, but the build give me the following error.

screen shot 2018-06-24 at 5 14 57 pm
screen shot 2018-06-24 at 5 09 42 pm

Here the error is obvious. It searchs for electron/index.html/style.css instead of electron/style.css
Where this bug could come from ?

  • Node version: v10.4.0
  • NPM version: YARN 1.7.0
  • Operating System: macOS sierra 10.12.6

Most helpful comment

For those with the same error, it was something else a little tricky.
I had a mistyping in the URL I was loading. I added by mistake a trailing /.
When you yarn dev, your url is localhost:some_port, so adding a '/' does not matter. But when building, you use the index.htlm endpoint, and you should not add any '/' behind, or electron builder think it is a dir, and search from 'index.html' and not from root '/'

So, just mistyping js bug business as usual, just use Typescript :)

All 3 comments

How are you bringing in the CSS file? Are you using SASS?

If you're using sass, you should just import the SCSS code like so in the App.vue file:

<style lang='scss'>
    @import './scss/app';
</style>

Then your CSS should be automatically injected into the head of the DOM.

This isn't really even nearly enough to reproduce the issue, so I'm exactly not sure how anyone could solve this for you.

For those with the same error, it was something else a little tricky.
I had a mistyping in the URL I was loading. I added by mistake a trailing /.
When you yarn dev, your url is localhost:some_port, so adding a '/' does not matter. But when building, you use the index.htlm endpoint, and you should not add any '/' behind, or electron builder think it is a dir, and search from 'index.html' and not from root '/'

So, just mistyping js bug business as usual, just use Typescript :)

Was this page helpful?
0 / 5 - 0 ratings