Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMR is broken in laravel-mix 3.0 #194

Closed
jlsjonas opened this issue Feb 7, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@jlsjonas
Copy link
Contributor

commented Feb 7, 2019

This is a bug | feature request. (upstream bug, so a feature request?)

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
    (enso is made of many specialized packages: https://github.com/laravel-enso)
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

laravel-mix 3.X is having major issues with HMR (been debugging all day, either the connection works but the script errors out, or updates ain't happening whatsoever); after more googling it seems that it's an issue with laravel-mix 3.0; which was introduced fairly recently (end of january).
This was fixed in a 4.X release (JeffreyWay/laravel-mix#1834)

Steps to Reproduce

  1. yarn hot
  2. go to the site, HMR not active or causing errors

Expected behavior

HMR

Actual behavior

image

@aocneanu

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

unfortunately it won't work

https://laravel-mix.com/docs/4.0/upgrade

search for dynamic imports

@aocneanu

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

@jlsjonas

This comment has been minimized.

Copy link
Contributor Author

commented Feb 7, 2019

F... (I remember seeing that now that you link it 😅 )

back to 70 sec cycles via yarn dev for now, I guess (as the code no longer seems to be compatible with 2.1.11 which did work with HMR until then)

Just to verify, is HMR broken for you too? Or is it a ^#$^$%# windows issue again?

@aocneanu

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

windows for sure.

@jlsjonas

This comment has been minimized.

Copy link
Contributor Author

commented Feb 7, 2019

Great 😅
well... thanks for the confirmation

@jlsjonas jlsjonas closed this Feb 7, 2019

@jlsjonas

This comment has been minimized.

Copy link
Contributor Author

commented Feb 11, 2019

FYI: issue is related to Vendor Extraction (.extract)

tracking in JeffreyWay/laravel-mix#1991

workaround:
in webpack.mix.js replace the resources/js/enso.js definition with:

if (Mix.isUsing('hmr')) {
    mix.js('resources/js/enso.js', 'public/js');
} else {
    mix.js('resources/js/enso.js', 'public/js')
        .extract([
            '@fortawesome/fontawesome-free', '@fortawesome/fontawesome-svg-core',
            '@fortawesome/free-brands-svg-icons', '@fortawesome/free-regular-svg-icons',
            '@fortawesome/free-solid-svg-icons', '@fortawesome/vue-fontawesome', 'accounting-js',
            'axios', 'chart.js', 'chartjs-plugin-datalabels', 'css-element-queries', 'date-fns',
            'dropzone', 'file-saver', 'flatpickr', 'laravel-echo', 'lodash', 'popper.js',
            'pusher-js', 'quill', 'raven-js', 'textarea-caret', 'tiptap', 'tiptap-commands',
            'tiptap-extensions', 'tooltip.js', 'v-click-outside', 'v-tooltip', 'vue',
            'vue-quill-editor', 'vue-router', 'vuedraggable', 'vuex',
        ]);
}

this will return 404 errors for manifest.js & vendor.js during HMR (as they don't get generated without .extract, however this will not affect you otherwise)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.