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
ngc
norng build --prod
orng build --aot
I’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
--aot
and I tried all possible combinations with thetsconfig.json
from 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--aot
compiles successfully. In my case, the compiler was complaining about relative URLs to images in the assets folder from different component’s.css
files as being not found. I fixed all of them and--aot
compiled correctly.*I have WebStorm compile all
scss
files tocss
and reference the.css
files from my component’sstyleUrls
instead of using ng-cli’s built inscss
loader, if that’s relevant.I also noticed that there is no difference in the output files when using
--prod
or--prod --aot
, is--aot
the 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.json
fileSpecifying the
tsconfig.json
path in the command:"./node_modules/.bin/ng-xi18n" -p src/tsconfig.json
as 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.ts
files where I am have accidentally missed things. Can still runng-serve
but thei18n
command 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.json
In 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
files
property 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 lint
does not work anymore 😃#3993