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.

Error when mix JS files in production

See original GitHub issue
  • Laravel Mix Version: 0.12.0
  • Node Version: 7.10.0
  • NPM Version: 4.2.0
  • OS: Windows 10

Description:

I use Laravel Mix to mix CSS et JS files.

I use the command: npm run production

I have undefined in combined.js file.

But, the command npm run dev works.

I have this to mix:

mix.scripts([
    'public/backend/assets/js/jquery.min.js',
    'public/backend/assets/js/bootstrap.min.js',
    'public/backend/assets/js/detect.js',
    'public/backend/assets/js/fastclick.js',
    'public/backend/assets/js/jquery.slimscroll.js',
    'public/backend/assets/js/jquery.blockUI.js',
    'public/backend/assets/js/waves.js',
    'public/backend/assets/js/wow.min.js',
    'public/backend/assets/js/jquery.nicescroll.js',
    'public/backend/assets/js/jquery.scrollTo.min.js',
    'public/backend/plugins/switchery/switchery.min.js',
    'public/backend/plugins/bootstrap-sweetalert/sweet-alert.min.js',
    'public/backend/plugins/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js',
    'public/backend/plugins/waypoints/lib/jquery.waypoints.js',
    'public/backend/plugins/counterup/jquery.counterup.min.js',
    'public/backend/plugins/jquery-circliful/js/jquery.circliful.min.js',
    'public/backend/plugins/jquery-sparkline/jquery.sparkline.min.js',
    'public/backend/plugins/skyicons/skycons.min.js',
    'public/backend/assets/pages/jquery.dashboard.js',
    'public/backend/plugins/morris/morris.min.js',
    'public/backend/plugins/raphael/raphael-min.js',
    'public/backend/plugins/summernote/dist/summernote.min.js',
    'public/backend/assets/js/jquery.core.js',
    'public/backend/assets/js/jquery.app.js',
], 'public/backend/javascripts/combined.js');

Steps To Reproduce:

To reproduce error, you must type this command: npm run production

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
laracastscommented, May 28, 2017

Fixed in v0.12.1.

1reaction
tdondichcommented, May 25, 2017

This is related to https://github.com/JeffreyWay/laravel-mix/issues/828 . Note that specifying mix version 0.11.4 in your package.json resolves it until a fix is committed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when mix JS files in production · Issue #832 - GitHub
I use Laravel Mix to mix CSS et JS files. I use the command: npm run production. I have undefined in combined.js file....
Read more >
error with mix.js in production mode - Laracasts
Ok. I found a solution. I use platform cartalyst, which compiles the files again and minify it. I load the app.js the normal...
Read more >
Error trying to compile newest Laravel Mix 6 app.js
I have been using Laravel Mix to bundle my CSS and JS files, ... When I run npx mix --production, the resulting app.js...
Read more >
Frequently Asked Questions | Laravel Mix Documentation
If you're running npx mix through a VM, you may find that file changes are not picked up by webpack. If that's the...
Read more >
Compiling Assets (Mix) - The PHP Framework For Web Artisans
The webpack.mix.js file is your entry point for all asset compilation. ... To avoid JavaScript errors, be sure to load these files in...
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