angular-block-ui icon indicating copy to clipboard operation
angular-block-ui copied to clipboard

bower install does not install src folder and causes source map errors

Open westor21 opened this issue 11 years ago • 4 comments
trafficstars

bower install angular-block-ui installs only the dist directory. Running the app with the uncompressed files in chrome brings up errors like this: Failed to locate workspace file mapped to URL http://localhost/bower_components/angular-block-ui/src/angular-block-ui/angular-block-ui-header.js from source map http://localhost/bower_components/angular-block-ui/dist/angular-block-ui.js.map

westor21 avatar Oct 07 '14 13:10 westor21

Hi,

it should only contain the dist folder; the src contents is mangled into the .map files. I'm not quite sure why you're getting this error, it's working fine for me and some colleagues (plus it's working in Firefox too).

Have you tried starting Chrome with a clean profile? (replace /dev/null with some temporary folder.)

  • OSX: open -a "Google Chrome" --args --user-data-dir=/dev/null
  • Linux: google-chrome --user-data-dir=/dev/null
  • Windows: "C:\Users\username\AppData\Local\Google\Chrome\Application\chrome.exe" --user-data-dir=/dev/null

If this fixes the error message, you might have a corrupt workspace mapping in chrome. Clearing the profile directory should do the trick. https://support.google.com/chrome/answer/142059?hl=en

McNull avatar Oct 07 '14 14:10 McNull

Hmm, I have javascript source maps enabled in my devtools settings. When I start with a new profile, I think, this is not enabled, am I right? Therefore I wouldn't see those error messages. Did you note, I'm including the uncompressed source into my html file, because i want to minify all together while build step. When I include the minified version instead, I do not get any errors.

westor21 avatar Oct 07 '14 15:10 westor21

The current version of Chrome has source map support turned on by default.

The sourcemap of the minified version points to the un-minified angular-block-ui.js, which is an actual file and thus accessible directly by Chrome.

If you're uglifying the source yourself, you'll either have to remove the sourcemap comment (most uglifyers have an option for this) or rebuild the sourcemap with something like gulp-sourcemaps.

McNull avatar Oct 07 '14 17:10 McNull

Thank you for your hints.

westor21 avatar Oct 08 '14 05:10 westor21