Home
Support Forums

Failing vue-cli-service builds

The builds for a Vue web app of mine (https://easelear.netlify.app) have been failing for a while now with:

1:15:59 AM: $ npm run build
1:15:59 AM: > ezelsoor@0.1.0 build /opt/build/repo
1:15:59 AM: > vue-cli-service build
1:16:00 AM: -  Building for production...
1:16:02 AM:  ERROR  Failed to compile with 1 errors00:16:02
1:16:02 AM:  error  in ./src/main.js
1:16:02 AM: Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
1:16:02 AM: Thread Loader (Worker 0)
1:16:02 AM: Unexpected token {
1:16:02 AM:     at PoolWorker.fromErrorObj (/opt/build/repo/node_modules/thread-loader/dist/WorkerPool.js:262:12)
1:16:02 AM:     at /opt/build/repo/node_modules/thread-loader/dist/WorkerPool.js:204:29
1:16:02 AM:     at mapSeries (/opt/build/repo/node_modules/neo-async/async.js:3625:14)
1:16:02 AM:     at createScript (vm.js:80:10)
1:16:02 AM:     at Object.runInThisContext (vm.js:139:10)
1:16:02 AM:     at Module._compile (module.js:617:28)
1:16:02 AM:     at Object.Module._extensions..js (module.js:664:10)
1:16:02 AM:     at Module.load (module.js:566:32)
1:16:02 AM:     at tryModuleLoad (module.js:506:12)
1:16:02 AM:     at Function.Module._load (module.js:498:3)
1:16:02 AM:     at Module.require (module.js:597:17)
1:16:02 AM:     at require (internal/module.js:11:18)
1:16:02 AM:     at Object.<anonymous> (/opt/build/repo/node_modules/eslint/lib/cli-engine/index.js:3:23)
1:16:02 AM:  @ multi ./src/main.js
1:16:02 AM:  ERROR  Build failed with errors.

I’m unable to reproduce this locally, where I can run a build with success every time using Netlify’s environment:

  • Node 8.17.0
  • npm 6.13.4

Here’s a log from when it started happening: https://app.netlify.com/sites/easelear/deploys/5ee640020dd5ba00087c29c1 and here’s one from my most recent failed attempt: https://app.netlify.com/sites/easelear/deploys/5f9ca55d37778b0008e3e859

I have tried switching to the newer build image, but that didn’t change anything.

Most importantly, I retried to build an old commit before things started failing, and that now fails as well. See https://app.netlify.com/sites/easelear/deploys/5f9cac7273300837dddec12c.

I think it might have something to do with the build dependencies being unable to run on Netlify’s environment, but I feel stuck trying to debug it, especially now that it looks like older commits (with old versions of dependencies) also fail.

I solved it by using a more recent Node version, 14.15.x, on my dev box by setting environment variable NODE_VERSION to 14. Apparently some dependencies were not supported by the default Node version in Netlify’s environment.

1 Like