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.

Problem with electron-webpack integration

See original GitHub issue

I have some very similar problems with integrating bootstrap-vue with electron-webpack.

The interesting this is that this error only happens if I use the code with electron-webpack. I use bootstrap-vue without any problem in my vue project, but as soon as I put the code under electron-webpack, I get this error.

If I switch back the version to 2.0.0-rc.15, then the error disappears.

However, in both cases with electron-webpack the styles somewhy do not get applied. Again, in a simple vue project, everything is fine. Under electron-webpack, I get the error with the latest version AND I got not styling.

I have a webpack config in package.json:

...
"electronWebpack": {
    "main": {
      "webpackConfig": "webpack.config.js"
    }
}

and in the webpack.config.js:

module.exports = {
  "resolve": {
    "alias": {
      "vue": "vue/dist/vue.runtime.esm.js" // yes, I need the runtime
    }
  }
}

Any idea?

If I check the electron’s html in the debugger, I see no styles for bootstrap inserted.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
loopmodecommented, Jul 6, 2019

@mudlee

"electronWebpack": {
    "main": {
      "webpackConfig": "webpack.config.js"
    }
}

shouldn’t that be the “renderer” config instead of the the “main”? I guess Vue is only used in the renderer process…?

Update: I just read the docs and you need it for both renderer and main process.


However, since you’re using electron-webpack, if all you need is the alias, you don’t need custom configs at all, as electron-webpack does it automatically for vue project.

The issue with missing styles has nothing to do with bootstrap-vue - it is purely an electron-webpack problem (caused by my humble self…) and it’s fixed in version 2.7.2.

Please see https://github.com/electron-userland/electron-webpack/issues/302#issuecomment-508911966

In summary, I suggest this issue be closed, as it really is not an issue of bootstrap-vue.

1reaction
tmorehousecommented, Jul 5, 2019

The CSS issue isn’t related to the multiple vue instances.

I think electron makes some assumptions about libraries and that all styles associated with a component are scoped styles (part of a SFC file), which is not the case with BootstrapVue

Or there might be a special way that electron needs the CSS loaded. It shouldn’t be mangling the Bootstrap v4.x class names

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron-webpack not working with webpack5 #408 - GitHub
But the electron-webpack seems to be incompatible with the breaking change from webpack 5. I looked at webpack docs, it says namedImports ...
Read more >
Bundle error using webpack for Electron application `Cannot ...
I am trying to create an Electron application with React. I use Webpack to compile the React JSX syntax, but when I try...
Read more >
How to build an Electron app using create-react-app ... - Medium
There is a problem with this: create-react-app (by default) builds an index.html that uses absolute paths. This will fail when loading it in...
Read more >
electron-webpack
Unfortunately when creating electron applications, all of that setup just became much more difficult. The primary aim of electron-webpack is to eliminate all ......
Read more >
Start a new Electron app with React and Typescript.
electron/main.ts : webPreferences: { nodeIntegration: false · webpack.react.config.js : target: //"electron-renderer", "web",.
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