Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
westor21 opened this issue Oct 7, 2014 · 4 comments
Open

Comments

@westor21
Copy link

westor21 commented Oct 7, 2014

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

@McNull
Copy link
Owner

McNull commented Oct 7, 2014

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

@westor21
Copy link
Author

westor21 commented Oct 7, 2014

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.

@McNull
Copy link
Owner

McNull commented Oct 7, 2014

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.

@westor21
Copy link
Author

westor21 commented Oct 8, 2014

Thank you for your hints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants