App not working in production mode using ng build --prod
See original GitHub issuePlease provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Build on: Windows 10 Running on: Linux shared hosting
- Versions. Please run
ng --version
. If there’s nothing outputted, please run in a Terminal:node --version
and paste the result here:
ng --version angular-cli: 1.0.0-beta.14 node: 6.5.0 os: win32 x64
3 + 4. Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.
I created an Angular 2 project using Angular 2 CLI and used ng build --prod command and got no errors.
When I upload the dist folder into my website, I get the following error when the app loads:
http://i.stack.imgur.com/qEEEU.png
Uncaught TypeError: this._input.charCodeAt is not a function_Tokenizer._advance @ main .688167 c….bundle.js: 1716 _Tokenizer @ main .688167 c….bundle.js: 1716 tokenize @ main .688167 c….bundle.js: 1709 Parser.parse @ main .688167 c….bundle.js: 219 HtmlParser.parse @ main .688167 c….bundle.js: 380 DirectiveNormalizer.normalizeLoadedTemplate @ main .688167 c….bundle.js: 598 DirectiveNormalizer.normalizeTemplateSync @ main .688167 c….bundle.js: 598 DirectiveNormalizer.normalizeDirective @ main .688167 c….bundle.js: 598 RuntimeCompiler._createCompiledTemplate @ main .688167 c….bundle.js: 1090(anonymous
function) @ main .688167 c….bundle.js: 1090(anonymous
function) @ main .688167 c….bundle.js: 1090 RuntimeCompiler._compileComponents @ main .688167 c….bundle.js: 1090 RuntimeCompiler._compileModuleAndComponents @ main .688167 c….bundle.js: 1090 RuntimeCompiler.compileModuleAsync @ main .688167 c….bundle.js: 1090 PlatformRef_._bootstrapModuleWithZone @ main .688167 c….bundle.js: 717 PlatformRef_.bootstrapModule @ main .688167 c….bundle.js: 717(anonymous
function) @ main .688167 c….bundle.js: 1509 __webpack_require__ @ inline.js: 1(anonymous
function) @ main .688167 c….bundle.js: 2131 __webpack_require__ @ inline.js: 1 window.webpackJsonp @ inline.js: 1(anonymous
function) @ main .688167 c….bundle.js: 1
I’m using the latest Angular 2 CLI with webpack and Angular 2 RC.7
What could have gone wrong?
The this._input.charCodeAt is only used in the angular compiler folder as below: enter image description here
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
ng build --prod is not working properly? how to check this?
i want to check this application in production mode. Here i have attached my code: import { Component, ViewChild, OnInit ...
Read more >Identify and Fix Build and Deployment Errors in Your Angular ...
Many common build errors may occur as a result of rebuilding your app while using ng serve or running ng build or ng...
Read more >How To Run The Angular Service Worker In Production Mode
The build works just fine but I'm not able to get the app on ... After creating the production folder and running the...
Read more >Deploying an application - Angular
To stop the ng serve command, press Ctrl + c . Building and hosting your applicationlink. To build your application for production, use...
Read more >Development and Production Builds - The Angular Book
By default it is running in development mode (an equivalent of ng build -dev ) ... You can use the following command to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It caused because my browser cached the inline.js. Adding some params to the inline.js fixed it.
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.