Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Safe access to 'src' of the last "script" tag #30

Merged
merged 1 commit into from
Jan 23, 2018
Merged

Safe access to 'src' of the last "script" tag #30

merged 1 commit into from
Jan 23, 2018

Conversation

ilyazub
Copy link
Contributor

@ilyazub ilyazub commented Jan 23, 2018

There is an error in dev-tools on first page load.

Cannot read property 'src' of undefined
    at getCurrentScriptUrl (hotModuleReplacement.js:17)
    at webpackJsonp.../node_modules/css-hot-loader/hotModuleReplacement.js.module.exports (hotModuleReplacement.js:93)

webpack-dev-server triggers rebuild right after first bundle without any changes in sources. This issue with webpack-dev-server is covered many times, most detailed is webpack/watchpack#25.
Full load of heavy-weighted SPA (even in development environment) doesn't finish before rebuild, module.hot.dispose is called, error is thrown.

This PR works around webpack/watchpack#25 for css-hot-loader.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 82.418% when pulling 701af6c on ilyazub:safe_access_to_script_src into 1fa44f3 on shepherdwind:master.

@ilyazub
Copy link
Contributor Author

ilyazub commented Jan 23, 2018

@shepherdwind Should I add tests for that case or we just skip 0.3% coverage decrease.

@shepherdwind
Copy link
Owner

I think this case don't need test, this coverage decrease can ignore.

@ilyazub
Copy link
Contributor Author

ilyazub commented Jan 23, 2018

May you merge this pull request?

@shepherdwind shepherdwind merged commit 72f7099 into shepherdwind:master Jan 23, 2018
@shepherdwind
Copy link
Owner

v1.3.6

@shepherdwind
Copy link
Owner

Thanks for you pr.

@ilyazub ilyazub deleted the safe_access_to_script_src branch January 23, 2018 14:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants