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

Module not found: Error: Can't resolve - Error #205

Open
arajooj opened this issue Apr 8, 2021 · 3 comments
Open

Module not found: Error: Can't resolve - Error #205

arajooj opened this issue Apr 8, 2021 · 3 comments

Comments

@arajooj
Copy link

arajooj commented Apr 8, 2021

I'm having a problem when running the project with minecraft-launcher-core-node imports.

I'm using this repository as an initial template: https://github.com/maximegris/angular-electron

image

But just importing the packages and using a function already appears several errors

image

Does anyone know how to fix it? or if you have an electron + minecraft-launcher-core-node template ready to start?

@ci010
Copy link
Collaborator

ci010 commented Apr 8, 2021

I guess these lines of code are in renderer process (browser).

You need to open nodeIntegration for that browser window to use node modules. (All missing modules are node modules)

But I suggest you to put the launch logic in main process.

Update:

After I investigated this ng template... It seems that the ng build system won't be able to require the node modules.

I even cannot use fs here. I suggest you to use react template or vue template.

image

For vue template, you can try this https://github.com/ci010/electron-vue-next

@arajooj
Copy link
Author

arajooj commented Apr 9, 2021

I guess these lines of code are in renderer process (browser).

You need to open nodeIntegration for that browser window to use node modules. (All missing modules are node modules)

But I suggest you to put the launch logic in main process.

Update:

After I investigated this ng template... It seems that the ng build system won't be able to require the node modules.

I even cannot use fs here. I suggest you to use react template or vue template.

image

For vue template, you can try this https://github.com/ci010/electron-vue-next

Thank you very much for your reply, and thanks for the link to the template in vue.
Would there be any in React too?

@ci010
Copy link
Collaborator

ci010 commented Apr 10, 2021

Thank you very much for your reply, and thanks for the link to the template in vue.
Would there be any in React too?

That template actually will works with react. Vite use plugin to switch between different frameworks like vue, react, svelte, etc.

You can install react plugin and then use jsx/tsx in it.

I think I will update that tool to make react work later.

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

2 participants