Macil / browserify-hmr

Hot Module Replacement plugin for Browserify
MIT License
373 stars 26 forks source link

Doesn't handle $$ in filenames correctly #29

Closed krainboltgreene closed 7 years ago

krainboltgreene commented 8 years ago

Ran into this error:

Uncaught TypeError: Cannot set property 'module' of undefined

Turns out there's a bug with the filenames?

screen shot 2016-04-28 at 1 57 23 am screen shot 2016-04-28 at 1 57 28 am screen shot 2016-04-28 at 1 57 32 am

Have you considered checksums?

krainboltgreene commented 8 years ago

Turns out this was node-fs-extra's fault, but since it depends on it I suggest keeping this open until they fix and have an update pushed.

I also still suggest using checksums for the property names, since filenames can be really crazy.

Macil commented 7 years ago

Nah, there was a real issue in browserify-hmr here. Turns out if you do someString.replace(foo, bar), then if bar is a string with $ characters, they get treated specially. The fix was to change bar to be a function that returns a string, which .replace doesn't do anything special with.

Fixed in browserify-hmr 0.3.2.