angular: NoOpAnimationDriver error with ng-xi18n
I’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
ng-xi18n with angular 2.4.0 fails with exception Error: Error encountered resolving symbol values statically. Calling function 'NoOpAnimationDriver'. Builds fine with ng build --prod or ng serve.
Expected behavior Extract xlf without errors
Please tell us about your environment: angular-cli: 1.0.0-beta.24 node: 6.2.2 os: win32 x64
-
Angular version: 2.4.0
-
Browser: n/a
-
Language: TypeScript 2.0.3
-
Node (for AoT issues):
node --version= node: 6.2.2
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 27 (5 by maintainers)
Excluding the “test.ts” file in tsconfig.json resolved the issue for me.
... "exclude": [ "test.ts" ], "angularCompilerOptions": { "genDir": "../locale" } ...I’m getting this error but as far as I can remember I’m not trying to use i18 in any part of my project. Is this coming from Material 2? Are there any commonly known modules that raise this issue? I can’t start
ngcnorng build --prodorng build --aotI’m getting the infamous
ERROR in Error encountered resolving symbol values statically. Calling function 'NoOpAnimationDriver'...errorUPDATE SOLUTION @hansl @chuckjaz @tbosch @matsko
It turns out this is not an issue with i18 at all. The error message shown are simply IRRELEVANT. I found an old project that has worked with
--aotand I tried all possible combinations with thetsconfig.jsonfrom that old project and got it working. WELL, it is not really working straight away, but it shows some very helpful errors that I needed to resolve until--aotcompiles successfully. In my case, the compiler was complaining about relative URLs to images in the assets folder from different component’s.cssfiles as being not found. I fixed all of them and--aotcompiled correctly.*I have WebStorm compile all
scssfiles tocssand reference the.cssfiles from my component’sstyleUrlsinstead of using ng-cli’s built inscssloader, if that’s relevant.I also noticed that there is no difference in the output files when using
--prodor--prod --aot, is--aotthe default now when using--prod?Following people’s recommendation I can confirm I was able to get around this issue by
Adding
"exclude": [ "test.ts" ]to thetsconfig.jsonfileSpecifying the
tsconfig.jsonpath in the command:"./node_modules/.bin/ng-xi18n" -p src/tsconfig.jsonas this is where the angular-cli added mine by defaultChanging all scss imports to (for example)
@import "filename.scss"WITH the filename extensionFixing any errors as they came up, tended to be with
.spec.tsfiles where I am have accidentally missed things. Can still runng-servebut thei18ncommand needed everything fixed@rexthk if the tsconfig.json TypeScript configuration file is located somewhere other than in the root folder, you must identify the path to it with the -p option:
./node_modules/.bin/ng-xi18n -p src/tsconfig.jsonIn case you’re using wallabyJs, also exclude wallabyTest.ts in your tsconfig.json:
Note that the BrowserTestingModule will be compiled, leading to this error, as soon at least one test that uses the TestBed is included in the AoT compilation.
You can exclude files from the compilation by setting the
filesproperty in thetsconfig.json, or usingexclude.On Thu, Dec 22, 2016 at 9:16 AM Chuck Jazdzewski notifications@github.com wrote:
When you exclude test.ts in tsconfig.json
ng lintdoes not work anymore 😃#3993