Skip to content
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

Unterminated attribute value in a template results in cryptic AOT compilation errors with cli (or no errors with ngc) #20902

Closed
IgorMinar opened this issue Dec 9, 2017 · 3 comments

Comments

@IgorMinar
Copy link
Member

@IgorMinar IgorMinar commented Dec 9, 2017

I'm submitting a...


[x] Bug report  

Current behavior

Given a template:

hello <div class=">world</div>

@angular/cli reports very cryptic error and @angular/compiler-cli doesn't report any errors at all. JIT compiler reports correct error message.

Expected behavior

I'd like to get an error that tells me that I have unterminated attribute value.

This works correctly in JIT: http://plnkr.co/edit/x7wVVkf8VROCPSlkszJS?p=preview

Minimal reproduction of the problem with instructions

ng new foo
cd foo
cat 'hello<div class=">world</div>' > ./src/app/app.component.html 

then use ngc to build:

yarn ngc -p src/tsconfig.app.json 

And you get no error:

yarn run v1.3.2
$ /Users/iminar/Dev/ng-hq/client/node_modules/.bin/ngc -p src/tsconfig.app.json
  Done in 2.94s.

then use cli+aot to build:

yarn ng build --aot

and you get uninformative error from the guts of webpack:

yarn run v1.3.2
$ ng build --aot
Date: 2017-12-09T00:25:57.363Z                                                          
Hash: 06f14a38832d43ca634b
Time: 3809ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 1.08 MB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 199 kB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 11.4 kB [initial] [rendered]

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './app/app.module.ngfactory' in '/Users/iminar/Dev/ng-hq/client/src'
resolve './app/app.module.ngfactory' in '/Users/iminar/Dev/ng-hq/client/src'
  using description file: /Users/iminar/Dev/ng-hq/client/package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/iminar/Dev/ng-hq/client/package.json (relative path: ./src)
    using description file: /Users/iminar/Dev/ng-hq/client/package.json (relative path: ./src/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory.js doesn't exist
      as directory
        /Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory doesn't exist
[/Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory]
[/Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory.ts]
[/Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory.js]
[/Users/iminar/Dev/ng-hq/client/src/app/app.module.ngfactory]
 @ ./src/main.ts 3:0-66
 @ multi ./src/main.ts
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment


Angular version: 5.1.0
CLI: 1.6.0
@chuckjaz
Copy link
Contributor

@chuckjaz chuckjaz commented Dec 18, 2017

Fixed by #20846

@chuckjaz chuckjaz closed this Dec 18, 2017
Compiler automation moved this from Pri 0 to Done Dec 18, 2017
@IgorMinar
Copy link
Member Author

@IgorMinar IgorMinar commented Dec 19, 2017

@chuckjaz chuckjaz removed this from Done in Compiler Dec 19, 2017
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Sep 13, 2019

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 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.