bozon | Command line tool for building | Runtime Evironment library
kandi X-RAY | bozon Summary
kandi X-RAY | bozon Summary
Command line tool for building, testing and publishing modern Electron applications. Bozon is a simple, easy to use tool that unifies the existing build tools for Electron development. Simplify building, compiling, running, testing, and packaging your Electron applications.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Represents the Commander .
bozon Key Features
bozon Examples and Code Snippets
Community Discussions
Trending Discussions on bozon
QUESTION
I am trying to make an desktop app using electron and react. But when I am using React.lazy()
it doesn't work in production mode when I package app and it shows just an empty screen (in dev mode it works fine always)
Here is an error:
Element type is invalid. Received a promise that resolves to: function(){return l.a.createElement("div",null,l.a.createElement("h1",null,"Simple Component"))}. Lazy element type must resolve to a class or function.
I read lots of articles but still didn't managed to make it work. I tried different webpack configuration, electron-packager, electron-builder, bozon - but nothing helped to make it work with lazy.
I still can make it work without using lazy()
but wanted to figure out what's wrong with lazy()
approach.
For this case I created a simple repository at github (Electron Lazy Repo) to let you easier find all available information.
SimpleComponent.js
...ANSWER
Answered 2020-Jun-08 at 08:10For me, the issue was with the babel-minify-webpack-plugin
which I was using to minify my code. Removing that seemed to fix my isse. My guess is, they were saving function definitions as strings to save space, and using eval somewhere inside its logic. But that's just my guess. Maybe it'll fix it for you as well?
Anyway, the Github page for babel-minify-webpack-plugin says that it is deprecated, so I ended up removing that from my project, and using the terser-webpack-plugin instead. Everything seems to work now, and the build time is also significantly reduced. My advice is, avoid using the babel-minify-webpack-plugin
and use some other minification plugin instead
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bozon
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page