reinvanoyen's avatar

Error after upgrading to mix v6

Hi all,

I tried upgrading to mix v6 from mix v5 for my Laravel package. I followed along the upgrade notes found on https://laravel-mix.com/docs/6.0/upgrade. Everything seems to work fine, except for mix.version() in combination with mix.copy(). It is however needed to copy the built files to the Laravel application from my package directory for easier development of the package.

It all works fine when I run npm run dev but not when I run npm run prod because then it calls mix.version(), which gives me the following error: Error: ENOENT: no such file or directory, open '/Users/rein/Workspace/my-app/my-package/public/public/vendor/my-package/app.css' (Of course that file does not exist, the file path is all wrong)

Before ( works on mix v5):

mix
    .sass('resources/sass/app.scss', 'public')
    .react('resources/js/app.js', 'public')
    .setPublicPath('public')
    .copy('public', '../public/vendor/my-package');

if (mix.inProduction()) {
    mix.version();
}

After (does not work on mix v6):

mix
    .sass('resources/sass/app.scss', 'public')
    .js('resources/js/app.js', 'public').react()
    .setPublicPath('public')
    .copy('public', '../public/vendor/my-package');

if (mix.inProduction()) {
    mix.version();
}

Can someone point me in the right direction? Thanks in advance!

0 likes
0 replies

Please or to participate in this conversation.