question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Laravel-mix `npm run production` hangs at "91% additional asset processing" then exits to command line

See original GitHub issue
  • Laravel Mix Version: 1.0.6
  • Node Version: 6.11.0
  • NPM Version: 5.0.3
  • OS: Ubuntu Server 16.04.2 LTS

Description:

During my application’s deploy process, running npm run production causes laravel-mix and/or webpack to hang at 91% additional asset processing, and then exits to the command line without completing asset compilation. This issue has been mentioned on the webpack issue tracker and has been closed, but I can’t seem to figure out what the actual solution is for a laravel-mix user, aside from updating everything to the latest version(s) which did not seem to help. I believe this is occurring because I have a very large SPA project with many Vue components and it is running out of memory while minifying/concatenating everything. (Running npm run dev works fine.) I don’t know enough about webpack personally, I just use laravel-mix.

Steps To Reproduce:

  • Large single-page-app project with lots of Vue components and vue-router. (Sorry I cannot provide this.)

  • Use the following package.json file:

{
  "private": true,
  "scripts": {
    "dev": "cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env NODE_ENV=development webpack --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "cross-env NODE_ENV=development webpack-dev-server --watch-poll --inline --hot --output-public-path http://myapp.local/ --host myapp.local --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "cross-env NODE_ENV=production webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.2",
    "bootstrap": "^3.3.7",
    "bootstrap-sass": "^3.3.7",
    "jquery": "^3.2.1",
    "laravel-mix": "^1.0.3",
    "lodash": "^4.16.2",
    "pusher-js": "^4.0.0",
    "select2": "^4.0.3",
    "vue": "^2.2.6",
    "vue-multiselect": "^2.0.0-beta.15",
    "vue-resource": "^1.3.1",
    "vue-router": "^2.4.0"
  },
  "dependencies": {
    "cross-env": "^5.0.1",
    "laravel-echo": "^1.3.0",
    "moment": "^2.18.1",
    "moment-timezone": "^0.5.13",
    "rrule": "^2.2.0",
    "webpack": "^3.0.0"
  },
  "peerDependencies": {
    "webpack": "^2.2.0"
  }
}

  • Then run npm run production to compile all assets.

As a side note, the package.json file above also gives me issues with unmet peer dependencies when I run npm list --depth=0. I see an UNMET PEER DEPENDENCY for webpack@3.0.0 but also npm ERR! peer dep missing: webpack@^2.2.0 for multiple other packages. This is why I was trying to include them both somehow, but I don’t know how to install multiple versions of webpack the correct way to meet these peer dependencies.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

15reactions
ruchernchongcommented, Jun 23, 2017

@shorlbeck It happened to me on my production server where I only had 512MB of RAM. I added a 2 GB swapfile and the compiling continued past 91% additional asset processing.

Might be related: https://www.digitalocean.com/community/questions/npm-gets-killed-no-matter-what

9reactions
BibekSthacommented, Nov 8, 2019

Anyone coming back to this page, I can confirm creating swapfile fixed the problem for me.

OS: Ubuntu 18.04.3 LTS Node: 10.17.0 NPM: 6.11.3 Laravel-mix: 2.1.14

RAM: 4GB Swap: 4GB

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel-mix `npm run production` hangs at "91% additional ...
Laravel-mix npm run production hangs at "91% additional asset processing" then exits to command line #926.
Read more >
Laravel-mix `npm run production` hangs at "91% additional asset ...
Laravel -mix `npm run production` hangs at "91% additional asset processing" then exits to command line.
Read more >
unable to compile assets in production with npm run ...
I had same issue because I used to put MIX_SENTRY_DSN_PUBLIC in webpack like this (NOT WORKING): mix.js('resources/js/app.js', process.env.
Read more >
How To Fix “Laravel Mix NPM run dev error” - YouTube
This video will help you to solve the annoying “ Laravel Mix NPM run dev error” that you probably have seen before when...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/28 19 ...
Command line interface for Amazon Glacier. ... Bug:455458 - "sys-process/psmisc: fuser hangs if processes have files open on dead remotes" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found