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.

Does not compile assets on Linux Servers

See original GitHub issue
  • Laravel Mix Version: #.#.# laravel-mix@0.10.0
  • Node Version: v6.10.1
  • NPM Version: 4.4.4
  • OS: LInux ADM64 Ubuntu Xenial

Description:

Hi

I have very strange problem, I have spinned off brand new 16.04 Ubuntu and same results, when deploy from git (or full checkout) and run npm run dev or npm run prod it just compiled very limited amount of assets:

            Asset       Size  Chunks             Chunk Names
           mix.js  537 bytes       0  [emitted]  mix
mix-manifest.json   26 bytes          [emitted]

Then the Laravel App complains that can not find mix Unable to locate Mix file: /css/login.css. Please check your webpack.mix.js output paths and try again.

When I run this on Mac I get this result:

                              Asset       Size  Chunks                    Chunk Names
  /js/login.14837ff8fc3cfefcf6bf.js     287 kB       0  [emitted]  [big]  /js/login
/css/login.22c40956ea8991802501.css    40.7 kB       0  [emitted]         /js/login
                  mix-manifest.json  116 bytes          [emitted]

And everything works.

I have same version of node, npm, i have done clean fresh install of npm install, even clean fresh of OS.

Any ideas?

Thanks

Petr

Steps To Reproduce:

run npm run dev or npm run prod on server.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
SabatinoMasalacommented, Mar 31, 2017

This issue happens on my server when using a symlinked node_modules directory.

module.exports.context would contain a reference to the parent of the original node_modules directory, making it unable to locate a webpack.mix.js file. https://github.com/JeffreyWay/laravel-mix/blob/master/setup/webpack.config.js#L33

This solution may work: https://github.com/JeffreyWay/laravel-mix/issues/533#issuecomment-287960097

2reactions
cerwcommented, Mar 31, 2017

@SabatinoMasala That must be it! I have my node_modules symlinked (same as storage) to speed up the deployment, trying #533 hack now and it works! Thank you, I thought was I was going bit crazy 😃 👍

More about this subject:

Who does compile assets on the server and who locally (if locally, how do you deploy to the server(s))? Some guys telling me to commit compiled assets into VCS, which I found very dull for many reasons.

If you use GIT -> CI -> CD (in a cloud) there is really no other way then compile assets on deploy? Am I wrong?

P

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does not compile assets on Linux Servers · Issue #650 - GitHub
A symlinked `node_modules` directory is pretty common when using a project with continuous integration where you are building on a production  ...
Read more >
Rails 5 Assets not compiling images or css - Stack Overflow
The app/assets folder still has all my image and css.scss files and js.coffee files as it always did. The app works perfectly in...
Read more >
Webpack assets doesn't work after deployment - GoRails
Try running "RAILS_ENV=production bundle exec rake assets:precompile" on the server and confirm it compiles your webpacker assets. The webpacker ...
Read more >
Capistrano 3: assets:precompile only on one server
Execute assets:precompile only on one server with Capistrano 3 ... If the assets directory is linked to glusterfs asset:precompile should only be executed...
Read more >
asset:precompile hangs when run remotely. - Google Groups
looks the same but somehow the asset:precompile is not finished yet. ... If the server is Linux-based, `strace` is great for figuring out...
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