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

Angular update issue. ( from 7.2.15 to 8.2.3 ) #32333

Closed
RayKimEX opened this issue Aug 27, 2019 · 4 comments
Closed

Angular update issue. ( from 7.2.15 to 8.2.3 ) #32333

RayKimEX opened this issue Aug 27, 2019 · 4 comments
Assignees
Milestone

Comments

@RayKimEX
Copy link

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No

Description

I updated angular version with ng update @angular/cli @angular/core command from 7.2.15 to 8.2.3

Compiling is fine.
But when i access to localhost:4200, console error occurs that Uncaught TypeError : StaticInjectorError[Compiler -> CompileMetadataResolver -> HtmlParser -> I18NHtmlParser]:
this.input.charCodeAt is not a function [compiler.js:9372]

the compiler.js file is in webpack:///./nodemodules/@angular/compiler/fesm2015/compiler.js

I debugged this through Call Stack.
the topmost Call stack is in main.ts

It points

platformBrowserDynamic().bootstrapModule(AppModule,
  {
    providers: [
      {provide: TRANSLATIONS, useValue: translations},
      {provide: TRANSLATIONS_FORMAT, useValue: 'xlf'}
    ]
});

I use this function for i18n of JIT purpose

🔬 Minimal Reproduction

You can find my minimal reproduction through https://github.com/RayKimEX/angular-issue.
Please see How to generate issue section my README.md file

🔥 Exception or Error




compiler.js:9372 Uncaught TypeError: StaticInjectorError[Compiler -> CompileMetadataResolver -> HtmlParser -> I18NHtmlParser]: 
  this.input.charCodeAt is not a function
    at PlainCharacterCursor.charAt (compiler.js:9372)
    at PlainCharacterCursor.updatePeek (compiler.js:9390)
    at PlainCharacterCursor.init (compiler.js:9358)
    at new _Tokenizer (compiler.js:8781)
    at tokenize (compiler.js:8743)
    at XmlParser.parse (compiler.js:9560)
    at XmlParser.parse (compiler.js:18429)
    at XliffParser.parse (compiler.js:18552)
    at Xliff.load (compiler.js:18491)
    at Function.load (compiler.js:19155)

🌍 Your Environment




    _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.0
Node: 12.9.1
OS: darwin x64
Angular: 8.2.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.0
@angular-devkit/build-angular     0.803.0
@angular-devkit/build-optimizer   0.803.0
@angular-devkit/build-webpack     0.803.0
@angular-devkit/core              8.3.0
@angular-devkit/schematics        8.3.0
@angular/cdk                      7.3.7
@angular/cli                      8.3.0
@ngtools/webpack                  8.3.0
@schematics/angular               8.3.0
@schematics/update                0.803.0
rxjs                              6.5.2
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant?

No.

@alan-agius4
Copy link
Contributor

Hi,

Thanks for reporting this, this is due to a breaking change in raw-loader version 2. See: https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md#200-2019-03-18

To fix the issue, you need to use the default export.

From

const translations = require('raw-loader!./i18n/messages.ko.xlf');

To

const translations = require('raw-loader!./i18n/messages.ko.xlf').default;

@alan-agius4
Copy link
Contributor

I am going to transfer this to the angular/angular repo to fix the docs in
https://angular.io/guide/i18n

@alan-agius4 alan-agius4 transferred this issue from angular/angular-cli Aug 27, 2019
@ngbot ngbot bot added this to the needsTriage milestone Aug 27, 2019
@alan-agius4 alan-agius4 self-assigned this Aug 27, 2019
atscott pushed a commit that referenced this issue Aug 27, 2019
…32334)

`raw-loader` version 2+ which is used in the CLI version 8 introduced a breaking change and now uses `export default` instead of `module.exports`.

See: https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md#200-2019-03-18

Closes #32333

PR Close #32334
@RayKimEX
Copy link
Author

Thank you!

sabeersulaiman pushed a commit to sabeersulaiman/angular that referenced this issue Sep 6, 2019
…ngular#32334)

`raw-loader` version 2+ which is used in the CLI version 8 introduced a breaking change and now uses `export default` instead of `module.exports`.

See: https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md#200-2019-03-18

Closes angular#32333

PR Close angular#32334
arnehoek pushed a commit to arnehoek/angular that referenced this issue Sep 26, 2019
…ngular#32334)

`raw-loader` version 2+ which is used in the CLI version 8 introduced a breaking change and now uses `export default` instead of `module.exports`.

See: https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md#200-2019-03-18

Closes angular#32333

PR Close angular#32334
@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 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants