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

async xsjs reports error as vm.SourceTextModule is not a constructor #9

Open
KeshavHeda opened this issue Aug 2, 2023 · 1 comment

Comments

@KeshavHeda
Copy link

We have migrated from xsjs to async-xsjs using tool and we can see async as well as await blocks.
But when we run the node app, it throws error as below.
File "/home/user/projects/SAP-TERMINOLOGY-DB/termdb_sched/lib/termdbreptask.xsjs" rejected: vm.SourceTextModule is not a constructor#
Aug 02, 2023 11:06:24 AM Logger.js [] ERROR: vm.SourceTextModule is not a constructor
TypeError: vm.SourceTextModule is not a constructor
at EcmaModule.getModule (/home/user/projects/SAP-TERMINOLOGY-DB/termdb_sched/node_modules/@sap/async-xsjs/lib/runtime.js:729:18)
at async Runtime.xsjs (/home/user/projects/SAP-TERMINOLOGY-DB/termdb_sched/node_modules/@sap/async-xsjs/lib/runtime.js:637:5)
at async Object.createRuntime (/home/user/projects/SAP-TERMINOLOGY-DB/termdb_sched/node_modules/@sap/async-xsjs/lib/runtime.js:446:9)
at async module.exports (/home/user/projects/SAP-TERMINOLOGY-DB/termdb_sched/node_modules/@sap/async-xsjs/lib/index.js:38:12)
at async startServer (file:///home/user/projects/SAP-TERMINOLOGY-DB/termdb_sched/server.js:52:27)
[ERROR] Node XSJS Server not running Some of the files in the working dir(s) were rejected. Check the logs.

@patricebender
Copy link

patricebender commented Nov 24, 2023

@KeshavHeda I had the same issue and was able to get my application running by adding the --experimental-vm-modules option to my startup command: node --experimental-vm-modules start.js

Hope this helps you as well!

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

No branches or pull requests

2 participants