harlan-zw / nuxt-webpack-optimisations

Make your Nuxt.js webpack builds faster ⚡
269 stars 8 forks source link

esbuild-loader error #31

Closed selfagency closed 3 years ago

selfagency commented 3 years ago

For some reason this worked just fine last week and now this week is throwing the following error regardless of profile. Project compiles fine if I disable.

✔ Client: Compiled with some errors in 21.10s
ERROR Failed to compile with 1 errors
ERROR in ./.nuxt/client.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
spawn Unknown system error -8
at PoolWorker.fromErrorObj (/usr/src/app/node_modules/thread-loader/dist/WorkerPool.js:346:12)
at /usr/src/app/node_modules/thread-loader/dist/WorkerPool.js:219:29
at mapSeries (/usr/src/app/node_modules/neo-async/async.js:3625:14)
at PoolWorker.onWorkerMessage (/usr/src/app/node_modules/thread-loader/dist/WorkerPool.js:173:34)
at /usr/src/app/node_modules/thread-loader/dist/WorkerPool.js:146:14
at Socket.onChunk (/usr/src/app/node_modules/thread-loader/dist/readBuffer.js:40:9)
at Socket.emit (events.js:400:28)
at ChildProcess.spawn (internal/child_process.js:403:11)
at spawn (child_process.js:667:9)
at Object.spawnWithSignal [as spawn] (child_process.js:871:17)
at ensureServiceIsRunning (/usr/src/app/node_modules/esbuild/lib/main.js:1716:29)
at transform (/usr/src/app/node_modules/esbuild/lib/main.js:1631:37)
at Object.ESBuildLoader (/usr/src/app/node_modules/esbuild-loader/dist/loader.js:58:37)
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
✔ Server: Compiled with some errors in 21.06s
selfagency commented 3 years ago

So this runs fine locally on my Mac and it runs fine on Codespaces, but the error arises when I run it in Docker.

harlan-zw commented 3 years ago

Hey @selfagency

Thanks for the issue, can you provide me with the docker image? Otherwise, what is the node version it's running?

selfagency commented 3 years ago
FROM node:14-alpine
RUN apk add curl git g++ make python3 dumb-init openjdk8-jre-lib
RUN npm -g i npm@latest node-gyp eslint typescript prettier stylelint textlint jest 
RUN pip3 install --user yamllint
ENV HOST=0.0.0.0
EXPOSE 3000
USER node
VOLUME /usr/src/app
WORKDIR /usr/src/app
CMD ["dumb-init", "npm", "run", "start"]
selfagency commented 3 years ago

If I reinstall your package from within Docker I get past that error to a heap overflow

selfagency commented 3 years ago

Jacked up the RAM in my container and it works

harlan-zw commented 3 years ago

Hm I see, sounds like a binary platform issue. A fresh install within docker would have built esbuild for the docker image, so can see why that worked.

Will close this off for now, thanks for the issue again