Hi there,
TLDR: Meteor 1.10.1 + Angular with AOT enabled breaks with method not found errors in angular-compilers library (part of angular-meteor project).
I’m having a lot of trouble trying to find a solution to allow me to update my project from meteor 1.8 to 1.10.1. The main issue is that the integration with Angular done through the angular-meteor library breaks the project - seems like this library is not maintained anymore (last update was in May 2019).
There are a couple of major issues with 1.10.1 + Angular:
- If you do ‘meteor add angular-compilers’ you get this error related to node-sass:
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit
[...]
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I was able to solve this by installing mibto:angular-compilers instead of original angular-compilers. It updates some versions for angular-compilers dependencies. This works ok, provided you disable AOT by setting this environment variable AOT=0 (by default it’s set to 1).
- Building with AOT enabled breaks with these errors:
- with Angular 7/8 I get:
compiler.ts:843:42: host.isSourceFile is not a function
- with Angular 9 I get:
angular-typescript-compiler/index.js:370:42: compiler.analyzeModulesAsync is not a function
This is the what I am struggling with because I really need to get AOT to work for performance reasons.
What makes this worse and urgent is that updating to 1.10.1 is mandatory for a lot of people because the latest version of Xcode doesn’t support the old version of Swift produced by Cordova 7 bundled with pre 1.10.1 version of meteor.
Any help figuring this out would be much appreciated!