piscinajs / piscina

A fast, efficient Node.js Worker Thread Pool implementation
https://piscinajs.github.io/piscina/
Other
4.22k stars 105 forks source link

Class extends value undefined is not a constructor or null #566

Closed alinopower closed 2 months ago

alinopower commented 4 months ago

Hello, I'm just encountrie this problem when i serve my angular application .

[error] TypeError: Class extends value undefined is not a constructor or null at Object. (C:\Users\PEAQ\Desktop\ANGULAR JAVA SPRING\Portfolio\node_modules\piscina\dist\src\index.js:815:32) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Users\PEAQ\Desktop\ANGULAR JAVA SPRING\Portfolio\node_modules\piscina\dist\src\main.js:5:33) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

When i look the index.js file i note that the Piscina class is define someone can help me to solve this? Thank you

Angular CLI: 14.2.13
Node: 16.10.0 Package Manager: npm 7.24.0 Angular: 14.3.0

metcoder95 commented 4 months ago

Hi @alinopower! Can you provide an Minimum Reproducible Example and which Piscina version are you using?

alinopower commented 4 months ago

Hi @metcoder95, when i start a new angular project with "ng new" i have the 3.2.0 piscina version and all work fine but when i try to install bootstrap piscina updates to version 4.4.0 and creates this problem

metcoder95 commented 4 months ago

Oh well, that's a major bump you are doing, maybe there's something within your implementation that is not working anymore.

Can you provide an Minimum Reproducible Example?

JaoodxD commented 3 months ago

@metcoder95 Piscina class extends EventEmitterAsyncResource.
According to docs EventEmitterAsyncResource was added in

Added in: v17.4.0, v16.14.0

@alinopower mentioned Node: 16.10.0. As a result, angular throws an error.
The easiest hotfix would be to upgrade Node.js version at least to 16.14.

JaoodxD commented 3 months ago

@metcoder95 Seems like Piscina isn't compatible for all 16.x node versions.
This breaking change was added by @addaleax 4 years ago here https://github.com/piscinajs/piscina/commit/2d0cc4eec56569998c997f8a756cc241cfbad8f5

metcoder95 commented 3 months ago

I see, I'd recommend tho to better upgrade to v16.14 or do not make the bump on Piscina until the Node version is fully upgraded on the application

github-actions[bot] commented 2 months ago

This issue has been marked as stale because it has been opened 30 days without activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.