Open andrewhughes101 opened 4 years ago
@andrewhughes101 This is because appmetrics-dash does not support being required into a worker_thread.
Using your app, reproduce without appsody by doing in your initialized app:
npm install appmetrics-dash
npm start --node-options --require=appmetrics-dash/attach
Fix is to do either, or all of:
if ! require('worker_threads').isMainThread
.--require=...
to worker_threads
Describe the bug When using worker threads in the nodejs stack, the following error is thrown when using appsody run:
The error is not produced using a appsody build and then a docker run.
To Reproduce Steps to reproduce the behavior:
app.js
Expected behavior The worker thread should send a message to the main thread which should then output
Hello World!
. This expected behaviour can be reproduced by runningnode app.js
in node 12 or laterEnvironment Details (please complete the following information):
Screenshots If applicable, add screenshots to help explain your problem.