Can't use aot with a let var in custom scripts
See original GitHub issueVersions
@angular/cdk: 5.0.0-rc0
@angular/cli: 1.5.2
@angular/material: 5.0.0-rc0
@angular/platform-server: 4.4.6
@angular/tsc-wrapped: 4.4.6
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.2
@schematics/angular: 0.1.2
typescript: 2.4.2
webpack: 3.8.1
Repro steps
- Create New Angular CLI Project
- Create a script file in src and add it to angular.cli
- Create a let var in custom script -
/src/custom-script.js -let object = {}
- Try to compile the project with --aot and --prod flag.
npm run build --aot --prod
Observed behavior
<!-- Normally this includes a stack trace and some more information. -->
You will get the error:
(node:22021) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
and no dist folder will be created.
Desired behavior
Successful aot build compilation and creation of a dist folder for the project.
Mention any other details that might be useful (optional)
I’ve created a repository with the custom script problem setup in .angular-cli.json.
Link: https://github.com/Jonathan002/angular-cli-broken-aot-demo
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
AOT metadata errors - Angular
AOT metadata errorslink · Expression form not supportedlink · Reference to a local (non-exported) symbollink · Only initialized variables and constantslink.
Read more >Method to pass environment variables during build vs file ...
We have a single environment.ts file for all builds and use a custom script to generate the correct values via the env variables....
Read more >Scripting restrictions - Unity - Manual
Unity provides a common scripting API and experience across all platforms it supports. However, some platforms have inherent restrictions.
Read more >Angular prod build error in Cannot assign to a reference or ...
Let's open this file and try to search the text Cannot assign to a reference or variable! . We will find the _AstToIrVisitor...
Read more >Custom AWS Lambda runtimes
It can be a shell script, a script in a language that's included in Amazon Linux, ... To use a custom runtime, set...
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
@tomastrajan thanks for taking this on. I also pinged the library owner there about this change.
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.