-
Notifications
You must be signed in to change notification settings - Fork 43
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
How to use with webdev #72
Comments
Aha I figured it out! For any people trying to get Electron to work... the problem is as follows. First, I enabled
This means that Electron adds the Node APIs to the web page when the page is loaded in an Electron window. This means you can do stuff like loading files, running processes etc. from your web page (running in Electron) that you couldn't do. However if you simply
in your This is mentioned in the Electron docs and I copied their solution:
And everything worked... until I tried to use I have now "solved" this by changing this code in
To this:
It would be great if there were an option to do this somehow. Also, my attempt to use |
This is more of a question than an issue: How do I use this with webdev?
Until now I had
build_web_compilers
in mypubspec.yaml
, aweb/index.html
file,web/main.dart
, and anindex.js
file to run Electron and have it showlocalhost:8080
.That worked great, until I tried to use
node_interop
. My code compiles but I get a runtime error about the module not being loaded. I presumed that is because I need to usebuild_node_compilers
instead ofbuild_web_compilers
.I swapped that in
pubspec.yaml
, and renamed theweb
directory tonode
, but when I runwebdev serve node:8080
it gives error:If I add them both then I get this error:
Ok well I was getting an error like
Could not find web/index.html or index.html
, but now I get this, even after removing.dart_tool
:How is this supposed to work?
The text was updated successfully, but these errors were encountered: