angular-hot-loader icon indicating copy to clipboard operation
angular-hot-loader copied to clipboard

Fixed "aSourceMapConsumer.eachMapping is not a function"

Open mars-dlx opened this issue 6 years ago • 3 comments

This fixed the issue #31. This solution should work in Webpack 2/3/4.

I can not test this solution today, because I do not have a project on angularjs. But I will test it on work project on Monday and report the result.

mars-dlx avatar Apr 27 '19 06:04 mars-dlx

This solution is working. But the source-map package was updated without checking its compatibility, which led to this issue, as well as to the fact that Travis could not run the check. Perhaps this has led to some other issues.

mars-dlx avatar Apr 29 '19 08:04 mars-dlx

@Mar-Ser your fix almost made the plugin work for me. Instead of the "aSourceMapConsumer.eachMapping is not a function" error, I get an error complaining about elm.injector() returning null and then calling has('$state') on it. Found it out by stepping through the code in the debugger.

Uncaught TypeError: Cannot read property 'has' of undefined
    at HotAngular../node_modules/angular-hot-loader/lib/angular-hot-loader.js.HotAngular.reloadState (angular-hot-loader.js:97)
    at HotAngular../node_modules/angular-hot-loader/lib/interceptors/config.js.module.exports [as config] (config.js:9)
    at Object../src/common/user/user.js (user.js:5)
    at __webpack_require__ (bootstrap:724)
    at fn (bootstrap:101)
    at Object../src/common/common.js (common.js:17)
    at __webpack_require__ (bootstrap:724)
    at fn (bootstrap:101)
    at Object../src/app.js (app.js:17)
    at __webpack_require__ (bootstrap:724)

Any ideas appreciated, would be so great to get HMR working :D

royalrex avatar Jun 27 '19 20:06 royalrex

@royalrex Sorry for I am not answering a long time... I spent much time to trying made it work. But even when it is not throwing errors - it is not do anything. So, I think it wastes time if it can not hot reload anything valuable...

mars-dlx avatar Feb 08 '20 08:02 mars-dlx