Angular 2: AOT TypeError: base64 is not a function

I try to compile my project with aot, but when I try the command

ngc -p tsconfig-aot.json

it generates aot folder with ngFactroy for the first time, but when I change main ts (as mentioned in angular docs) to bootstrap the new generated ngmodulefactory and recompile the project using the same command, I get the following error

TypeError: base64 is not a function at Function.from (native) at Function.from (native) at Object.extractInlineSourceMap (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/tsickle/build/src/source_map_utils.js:33:19) at TsickleCompilerHost.stripAndStoreExistingSourceMap (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/tsickle/build/src/tsickle_compiler_host.js:128:48) at TsickleCompilerHost.getSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/tsickle/build/src/tsickle_compiler_host.js:89:25) at findSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63453:29) at processImportedModules (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63600:25) at findSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63481:17) at processSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63384:27) at processRootFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63271:13) Compilation failed 

Am I doing something wrong?

+5
source share
2 answers

I found the answer, its problem with node js here, AOT requires node js v6 +, I just update my node and fix it, just send my answer if someone encounters this problem.

+6
source

This seems to be a known issue, check out the following link https://github.com/angular/angular-cli/issues/5711

0
source

Source: https://habr.com/ru/post/1266466/


All Articles