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

Installation in a node.js (electron) application is a little different #3

Open
snipercup opened this issue Dec 9, 2019 · 2 comments
Labels

Comments

@snipercup
Copy link

The examples work perfectly in a browser, but when loaded into a node.js application, it starts complaining about m not being defined. I found out that it's not loading mithril properly.

To fix it, I used NPM to install the mithril package and added "var m = require("mithril");" to editron-modules.js, which I have stored locally. Now I can load up your example, point to the local json files and it works.

@sagold
Copy link
Contributor

sagold commented Dec 19, 2019

Hi snipercup.

Thank you very much for the input. Per default, mithril is expected as an external dependency. This ensures, that only one mithril resource is loaded, if the application also uses mithril (mainly in browser contexts). It might be an option to prepare a separate nodejs-bundle in this case. I have not thought of electron in this context.

How did you embed editron within your application?

In most of may cases i directly compile editron and ensure that editron is compiled (or added) to my builds within the app-layer.

@snipercup
Copy link
Author

I put a <script> tag to the local editron js file in my application and it worked then.

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

No branches or pull requests

2 participants