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

Add vm.createScript #8312

Closed
patlux opened this issue Jan 21, 2024 · 1 comment
Closed

Add vm.createScript #8312

patlux opened this issue Jan 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@patlux
Copy link

patlux commented Jan 21, 2024

What is the problem this feature would solve?

node-red uses internally vm.createScript for the function node to run code which the user can provide in the web interface of node-red.

I need to run node-red with bun to support esm-modules, so I can write node-red extensions which are compiled by bun build.

$ bun run --bun node-red
[...]
0 Jan 23:47:55 - [error] [function:Screenshot] TypeError: vm.createScript is not a function. (In 'vm.createScript(functionText, createVMOpt(node, ""))', 'vm.createScript' is undefined) (body:line 381)
20 Jan 23:47:55 - [error] [function:Split] TypeError: vm.createScript is not a function. (In 'vm.createScript(functionText, createVMOpt(node, ""))', 'vm.createScript' is undefined) (body:line 381)
[...]

What is the feature you are proposing to solve the problem?

Implement vm.createScript which is just a wrapper for calling vm.Script().

See patlux/node-red@a587655

What alternatives have you considered?

Forking node-red and adding the mentioned wrapper if vm.createScript doesn't exist. Creating a PR to node-red to use vm.Script instead of vm.createScript?

@Jarred-Sumner
Copy link
Collaborator

Fixed in 3ca0fcb

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

No branches or pull requests

2 participants