Closed pjmagee closed 7 years ago
Can you show how you're doing it? Is this the ORIGIN_URL we're automatically providing in the engine?
Yeah it's the same code from the repo. I think something funny is going on here. I pulled down a fresh repo and added barrels in to see if our project was having side effects and after adding barrels/paths into this template project for things like app-models, app-modules, app-shared I'm getting errors like this....
ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator',
function calls are not supported. Consider replacing the function or lambda with a reference to an
exported function, resolving symbol NgModule in c:/projects/github/aspnetcore-angular2-
universal/node_modules/@angular/core/core.d.ts, resolving symbol ServerTransferStateModule in
c:/projects/github/aspnetcore-angular2-universal/Client/modules/transfer-state/server-transfer-
state.module.ts, resolving symbol ServerTransferStateModule in c:/projects/github/aspnetcore-angular2-
universal/Client/modules/transfer-state/server-transfer-state.module.ts
We're still currently based off the 2.0 branch of this template. But we have tons of components and shared services for api calls etc and we really wanted to push for the Angular4 template for things like productionising our application because of things like the baseURI and Cookies in transferData.
There's definitely some kind of error when it's trying to statically analyze the code, not sure why it's pointing at server transfer that's a pretty basic NgModule that doesn't even use useFactory, browser one does, but it's being exported properly.
I'm wondering if it's the barrels themselves that are causing this issue, right? Are you doing export * or export { Whatever } for everything.
Wondering if it's something like this https://github.com/angular/angular/issues/15767 causing it
Also for AoT references this is a great list: https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5
With the barrels I have the index.ts files with export * from './something'
. I'll check the links you provided.
Yeah try to export the actual item export { Something } from './something';
I think *
is one of the (many) things AoT static analysis isn't a fan of.
Yeah, I updated the *
and replace it with export { ActualClass } from './actual-class'
but the same problems occur. I think I've spent far too much time on just getting something to work 💃
Haha I feel you on that one 😿
So I just tried and was able to get Paths working, I only setup app-shared
so far in development, but no luck in AoT :(
Would you happen to know why trying to use
InjectionToken
as aProvide
value in my Providers for an Angular Module would blow up?