Skip to content

Unable to debug global scripts #6166

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

Closed
franktroia opened this issue May 3, 2017 · 3 comments
Closed

Unable to debug global scripts #6166

franktroia opened this issue May 3, 2017 · 3 comments
Assignees
Labels
effort1: easy (hours) help wanted P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient

Comments

@franktroia
Copy link

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0-rc.1
node: 6.10.0
os: win32 x64
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/upgrade: 2.4.10
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.10

Repro steps.

  1. Add a global script to .angular-cli.json
  2. Start with ng serve
  3. Use your favorite browser's dev tools and attempt to set a break point in your global script.

I can search for the script, but instead of finding the scripts source code, I find webpackified script.

module.exports = "'use strict';  <snipped>"

//////////////////
// WEBPACK FOOTER
// ./~/raw-loader!./~/source-map-loader!./app/src/app.js
// module id = 875
// module chunks = 0

The log given by the failure.

N/A

Desired functionality.

I should be able to search directly for the script and set a break point. As of now, the only way to set a break point in a global script is to modify the source and add a debugger; statement and reload.

This is a hybrid app where I'm loading the existing AngularJS JS code using global scripts, so being able to debug these scripts easily is desired.

I appreciate any help!

@filipesilva
Copy link
Contributor

This is a limitation of the current architecture. Stuff in scripts is concatenated and loaded exactly as is. There might be a way to configure it better so that debugging works.

@filipesilva
Copy link
Contributor

Fixed by #7279, insofar as the original scripts have sourcemaps and aren't modified by webpack itself anymore.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) help wanted P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient
Projects
None yet
Development

No branches or pull requests

2 participants