-
Notifications
You must be signed in to change notification settings - Fork 27
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
node ES6 import throws this error. #61
Comments
The only thing I can think here is that your target Node.js environment is somehow running an incredibly low memory environment that cannot allocate / execute a normal sized Wasm binary. Where are you running Node.js in this case? We could better support the ability to fall back to the JS implementation possibly but this is the first time we've heard of any Wasm execution issues in core so there must be some very specific environment contraints you are running under? |
I am running this in my cpanel. |
Which cpanel are you using here? |
I am using the cPanel provider babal.host, there is the plan called node js starter plan. |
I have the same issue, using cpanel from fullhost.io. |
internal/deps/cjs-module-lexer/dist/lexer.js:1 "use strict";exports.parse=parse;exports.init=init;const A=new Set(["implements","interface","let","package","private","protected","public","static","yield","enum"]);let Q;const B=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse(g,I="@"){if(!Q)throw new Error("Not initialized");const D=g.length+1,N=(Q.__heap_base.value||Q.__heap_base)+4*D-Q.memory.buffer.byteLength;N>0&&Q.memory.grow(Math.ceil(N/65536));const k=Q.sa(D);if((B?C:E)(g,new Uint16Array(Q.memory.buffer,k,D)),!Q.parseCJS(k,g.length,0,0,0))throw Object.assign(new Error( |
@KevinBrogan thanks for reporting. Could you perhaps share the output of |
debug.js
command line (import works)
output
debug.php
command line (import works)
output
website url in browser (import causes crash)
output
|
@KevinBrogan thanks for the info, but this still doesn't really narrow it down unfortunately. Do you know how is PHP calling into Node.js here? Is this a long-running JS process or is it being instantiated on each PHP request? Any information you have to help us dig into this further would be great. |
I know that php is using the back tick operator to call node via a
shell_exec, but I couldn't tell you much more than that. It's not a
long running process. It is instantiated on each request.
php command line works, it's only php via the server that is not working.
The http server is LiteSpeed
I also know that when I use my personal Apache server, everything works fine. It's
only on the hosted server that this issue comes up.
Server php API is LiteSpeed V7.9 Cloudlinux 1.3
php is 7.3.29
https://www.php.net/manual/en/language.operators.execution.php
…On Fri, 24 Sept 2021 at 02:20, Guy Bedford ***@***.***> wrote:
@KevinBrogan <https://github.com/KevinBrogan> thanks for the info, but
this still doesn't really narrow it down unfortunately.
Do you know how is PHP calling into Node.js here? Is this a long-running
JS process or is it being instantiated on each PHP request? Any information
you have to help us dig into this further would be great.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4VQ3NWCA6DFHJTQUIWG3UDQ7GXANCNFSM5DGCNLBA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@KevinBrogan is there any way you can check the output value of running the command |
Related Twitter thread - https://twitter.com/_rvidal/status/1442868528068108289?s=20 |
ulimit is set to unlimited from the command line, but 2GB when executed
from the server. Increasing to 4GB, which is how much memory the machine I
got it to work on has installed, made no difference.
Essentially, if I'm understanding this correctly... The webassembly is
allocating more memory than there exists on the system, with no intention
of using it all.
The web assembly needs a large unbounded virtual address space, for
whatever reason, so any ulimit on the virtual address space will cause the
program to crash.
…On Wed, 29 Sept 2021 at 01:12, Guy Bedford ***@***.***> wrote:
Related Twitter thread -
https://twitter.com/_rvidal/status/1442868528068108289?s=20
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4VQ3VEFND2PVSY3B5RT3UELC5ZANCNFSM5DGCNLBA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
i have the same issue. i installed the lts version of node v16.3.0 via nvm when i try to execute a command (ng .... ) via the cpanel terminal i got this error, but when i run the same command via ssh client (aka cmder) i dont get any error and run the command without any problem Did you try run the command via ssh client no the cpanel terminal @amanc1248 @KevinBrogan? |
I have the same issue by setting ulimit. I noticed there were no problems in other versions but the error comes in starting in |
Bump: I am also facing this issue, can easily reproduce by setting ulimit, and just imporint a single CJS module (in my case dotenv). Made an issue on node as well -> nodejs/node#42222 |
Bump: Me too, getting same error on my hosting. > ulimit
7812500
> ulimit -v
2025138
> require('v8').getHeapStatistics()
{
total_heap_size: 7495680,
total_heap_size_executable: 524288,
total_physical_size: 7581696,
total_available_size: 4339302872,
used_heap_size: 5831008,
heap_size_limit: 4345298944,
malloced_memory: 254104,
peak_malloced_memory: 606400,
does_zap_garbage: 0,
number_of_native_contexts: 2,
number_of_detached_contexts: 0,
total_global_handles_size: 8192,
used_global_handles_size: 3584,
external_memory: 972021
}
When running |
I've posted a possible fix in nodejs/node#43612. |
i am working on the node js app and it works fine locally. But when i try to host it to the cpanel it throws this,
i am using these versions,
npm@6.14.13
node@v14.17.3
my index.js
package.json file
debug log when i run
npm run
I searched a lot but could not find any answer.
Then I finally created this issue.
The text was updated successfully, but these errors were encountered: