Skip to content
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

Creating new Imba Electron app doesn't work with a lot of issues #591

Open
taw opened this issue Aug 22, 2021 · 6 comments
Open

Creating new Imba Electron app doesn't work with a lot of issues #591

taw opened this issue Aug 22, 2021 · 6 comments

Comments

@taw
Copy link
Contributor

taw commented Aug 22, 2021

Starting a new one:

$ npx imba create test-app
✔ Choose your template · electron-template
✔ Configure package.json? (y/N) · false
✔ Create project in directory: /Users/twegrzanowski/Downloads/repro/test-app? (Y/n) · true
ℹ Generating files from template

Cloning into '/Users/twegrzanowski/Downloads/repro/test-app'...
ℹ Installing dependencies
✔ Finished setting up project!

  Install the vscode extension for the optimal experience:
    https://marketplace.visualstudio.com/items?itemName=scrimba.vsimba

  Join the imba community on discord for help and friendly discussions:
    https://discord.gg/mkcbkRw

  Get started:

    > cd test-app
    > npm start

(node:56957) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)

Now running it:

$ npm run watch

And:

$ npm run start

That already has two minor issues:

  • printed instructions when creating new app are incorrect, that would not work, you need to npm run watch first
  • that deprecation would be nice to get fixed

But the real problem starts when I actually run the code, as preload doesn't seem to run, and console is full of errors:

Screenshot 2021-08-22 at 16 37 19

That's a long list:

  • preload script crashed somehow - it's definitely compiled to js at path it's trying to load, so not sure what is the crash - I think this is the core problem
  • really strange error "Electron failed to install correctly, please delete node_modules/electron and try installing again" - it does not go away after reinstalling, and other Electron apps work just fine, so it's maybe caused by preload crash?
  • index.html expects __hmr__.js which is not there (separate from preload issue)
  • DevTools failed to load SourceMap: Could not parse content for file:///__assets__/app/preload.js.map: Unexpected end of JSON input - those paths are wrong (separate from preload issue)
  • because preload did not run, those version spans it was trying to replace were not replaced
  • Uncaught (in promise) TypeError: Cannot read property 'invoke' of undefined - because preload did not run, button does this

I think figuring out why preload is crashing and fixing it would be the main thing. Bad parts to hmr, source maps, and minor things are probably not blocking development.

@stale
Copy link

stale bot commented Feb 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 18, 2022
@taw
Copy link
Contributor Author

taw commented Mar 11, 2022

The issue is still there, nothing changed.

@stale stale bot removed the stale label Mar 11, 2022
@codeluggage
Copy link
Contributor

@taw I wonder if https://github.com/tauri-apps/tauri would work instead?

@taw
Copy link
Contributor Author

taw commented Mar 12, 2022

@codeluggage That doesn't seem related to it at all.

@codeluggage
Copy link
Contributor

codeluggage commented Mar 13, 2022

@taw Yes, I meant to offer an alternative, not address the current Electron issues.

I've been curious about Tauri so I gave it a try - looks like it's working well: https://github.com/codeluggage/imba-tauri

If the Electron issues are blocking you, you could go this direction instead. I'll see about adding this as an alternative template for imba create.

EDIT: Added feature request here: #658

Copy link
Member

somebee commented Mar 13, 2022

The electron template should probably be removed from imba create until we have a decent one that works. Will get back to this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants