stutrek / scrollmonitor

A simple and fast API to monitor elements as you scroll
MIT License
3.3k stars 243 forks source link

scrollMonitor.js.map errors #61

Closed kierenj closed 7 years ago

kierenj commented 7 years ago

I may be using the package incorrectly, so please advise if so.

However, the packaged scrollMonitor.js has a reference to scrollMonitor.js.map. Webpack pulls in the main JS file but not the map, and so on every page I get error saying that it couldn't find or parse the map file.

Unless I should somehow be configuring my Webpack to look in minified JS files and pull our relative map paths and bundle them to (or it maybe it should be default?).

stutrek commented 7 years ago

Do you have source maps configured in webpack? It should be something along the lines of

    devtool: 'sourcemap'
kierenj commented 7 years ago

Ah - I do for production deployment, but not for development. I don't have a version running with the production deployment at the moment to check. Is it required to do this?

stutrek commented 7 years ago

Yeah, you should use source maps to stop this error and for your own sanity. Right now it's looking for the source map that it would use if you used a script tag, which isn't being served. When webpack builds with a source map it's smart enough to use the bundled one.