Open maifeeulasad opened 3 years ago
I'm having a similar problem with electron.
@borkdude, I couldn't still solve this problem. So I just went with the traditional approach, like this: https://github.com/maifeeulasad/WhatApp/blob/main/index.js
And everything is working fine now. Although my plan to use a 100% es6 based electron project is still a dream.
@maifeeulasad I developed a library to interpret ClojureScript code from files or strings:
https://github.com/borkdude/nbb/blob/main/test-scripts/api-test/test.mjs
The library is offered as an ES Module.
I would like to use this library from Electron, but so far I didn't succeed.
@borkdude Here is a really interesting article: https://blog.bitsrc.io/javascript-require-vs-import-47827a361b77
And here is a of answer, which you may also find helpful: https://stackoverflow.com/a/63942979/10305444
@maifeeulasad I don't see an example of how to use an ES module from an Electron app, but perhaps I'm missing something.
The full error looks like this, on running ``:
My node version is : v14.17.0
Here is my index.js :
Here is the main.js :
The scripts I'm also using are:
Although it starts and builds, but I get error when trying to run those built files.