-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
how can I import external js modules #137
Comments
As shown in the example here, in Electron version of the app you can import core node libraries and test it right away in System Designer. For modules from npm, you can require it normally in behaviors, but you can not test it with System Designer. You will need to export the system in Node.js format and follow these steps of the documentation:
I will update the documentation to explain how to use a npm module. |
When I export my system to Node and run it as per these instructions, I get the following error: "runtime: error when calling the action 'render' on component 'page-html' (HTMLComponent class): document is not defined". This occurs for every reference to 'document'. This error does not occur in System Designer. Am I missing something? |
It does not work because the system you run with node contains a reference to It works in System Designer because the system is executed in a browser (Chromium for the desktop version to be more precise), so you have access to I will update the documentation to add this missing information. |
That makes sense, thank you.
Tjerk
…On Wed., Mar. 2, 2022, 6:03 p.m. Erwan Carriou, ***@***.***> wrote:
It does not work because the system you run with node contains a reference
to document (see https://developer.mozilla.org/en-US/docs/Web/API/document)
which is not managed by Node.js.
It works in System Designer because the system is executed in a browser (
*Chromium* for the desktop version to be more precise), so you have
access to document.
I will update the documentation to add this missing information.
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXORIMSRBZ7ZD7DGU6SQFS3U57XUVANCNFSM4R2XKUMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm trying the exact example you provide in test-a-server-side-application and I'm getting the following error: I don't understand what I'm missing here... |
Do you have the latest version of System Designer (v5.2.0) ? |
Hmm, I haven't checked the version, I'll make sure it's up to date and I'll
try again.
Thanks,
Tjerk
…On Tue., Apr. 12, 2022, 1:37 p.m. Erwan Carriou, ***@***.***> wrote:
Did you have the last version of System Designer (*v5.2.0*) ?
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXORIMSNQDIMVBBIE7TPBYTVEWYGPANCNFSM4R2XKUMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
My version was out of date...
I'll have to remember to check for new versions 😀
Finally off to the races!
Thank you 🙏
Tjerk
…On Tue., Apr. 12, 2022, 1:37 p.m. Erwan Carriou, ***@***.***> wrote:
Did you have the last version of System Designer (*v5.2.0*) ?
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXORIMSNQDIMVBBIE7TPBYTVEWYGPANCNFSM4R2XKUMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
does system design support to import js modules from npmjs repo and call it in behavior?
The text was updated successfully, but these errors were encountered: