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

Bundling Error due to new dependency #19

Open
BenjaminVadant opened this issue Mar 11, 2021 · 1 comment
Open

Bundling Error due to new dependency #19

BenjaminVadant opened this issue Mar 11, 2021 · 1 comment

Comments

@BenjaminVadant
Copy link

Describe the bug

I'd like to use Nodes to expose an API endpoint.
But when I try to add express as a package, I'm getting a bundling error and it is impossible to load the project.

To Reproduce

Steps to reproduce the behavior:

  1. Add package "express"
  2. Require it in one node
  3. Save project
  4. Close Nodes
  5. Launch Nodes
  6. Load Project
  7. See "Bundling error" message

If I launch Nodes from the terminal, I'm seeing the following error

ERROR in ./node_modules/express/lib/request.js
Module not found: Error: Can't resolve 'net' in 'C:\Users\BenjaminVadant\Documents\Nodes\my-first-project\node_modules\express\lib'

Expected behavior

I'm expecting to see the error message in the editor and access to the editor to fix it.

From the error, I'm thinking that express is not (& will not be) supported as nodes code is executed client side.

Do you think it will be possible in the future to select a node to be executed server side ? It would be interesting to access system-level functionalities such as network, system usage....

Environment Information:

  • nodes: 1.0.0-beta.2
  • os: win32
  • node: 12.18.3
  • electron: 11.1.0
  • chrome: 87.0.4280.88

Related Issues

@dmnsgn
Copy link
Member

dmnsgn commented Mar 11, 2021

Hi @BenjaminVadant,

It looks like you're trying to install express which is in turn using net, probably not accessible in the browser. If you have trouble when reopening, you can manually delete express from package.json dependencies.

Nodes are meant to be for browser environments for now so you'll have to run your express server in a separate node.js process. It might be hard to provide a secure way to run server-side code in the current context but thanks for the suggestion.

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

No branches or pull requests

2 participants