You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AOT import * error: ERROR in Illegal state: symbol without members expected, but got #6443
Running command: webpack --env.aot --env.client & webpack --env.aot --env.server from aspnetcore-angular2-universal.
When importing components/services with * I get error if any import also includes *. For example this works:
//lazy.module.ts
import * as components from "./components/all";
//all.ts
import {SomeComponent} from "./some";
export {SomeComponent};
And this is not working:
//lazy.module.ts
import * as components from "./components/all";
//all.ts
import * as childs from "./childs"; //I THINK THIS CAUSE ERROR
import {SomeComponent} from "./some";
export {childs, SomeComponent};
//childs.ts
import {OtherComponent} from "./other";
export {OtherComponent};
The log given by the failure.
ERROR in Illegal state: symbol without members expected, but got {"filePath":"E:/test-project/trunk/test-project/Client/app/modules/lazy/components/all.ts","name":"childs","members":["OtherComponent"]}.
Desired functionality.
AOT compiles successfully.
Full error
ERROR in Illegal state: symbol without members expected, but got {"filePath":"E:/test-project/trunk/test-project/Client/app/modules/lazy/components/all.ts","name":"childs","members":["OtherComponent"]}.
ERROR in E:/test-project/trunk/test-project/Client/main.server.aot.ts (11,42): Cannot find module './ngfactory/app/server-app.module.ngfactory'.
ERROR in ./Client/main.server.aot.ts
Module not found: Error: Can't resolve './ngfactory/app/server-app.module.ngfactory' in 'E:\test-project\trunk\test-project\Client'
@ ./Client/main.server.aot.ts 7:0-87
If it helps I experience another interesting error inside nested lazy module.
ERROR in Unexpected value 'Category in e:/OpPISWeb/trunk/OpPISWeb/Client/app/modules/var-design/modules/admin/components/components.ts' declared by the module 'VarDesignAdminModule in e:/OpPISWeb/trunk/OpPISWeb/Client/app/modules/var-design/modules/admin/admin.module.ts'. Please add a @Pipe/@Directive/@Component annotation.
ERROR in e:/OpPISWeb/trunk/OpPISWeb/Client/main.server.aot.ts (11,42): Cannot find module './ngfactory/app/server-app.module.ngfactory'.
ERROR in ./Client/main.server.aot.ts
Module not found: Error: Can't resolve './ngfactory/app/server-app.module.ngfactory' in 'e:\OpPISWeb\trunk\OpPISWeb\Client'
@ ./Client/main.server.aot.ts 7:0-87
Components.ts:
import * as Category from "./category/category";
export { Category };
Error: Illegal state: symbol without members expected, but got {"filePath":"skipped/call-history/data/call-history-type.ts","name":"CallHistoryType","members":["AllCalls"]}.
I tried upgrading from 4.1.3 to 4.3.2, and got this issue. I had to go back to 4.1.3. Mine is caused by re-exporting Enums, but I assume that's the first stop, and then it will complain about all re-exports.
@brentwilton: tried your solution and it compiled with aot, but unfortunately the compiled code had null values while the non aot code worked - so the workaround didn't really work for me :(
(i' not using enums but constants like mentioned above)
tried angular-cli 1.27 and the new 1.3.0 but both didnt work
just getting this error during CLI AOT prod build.
ERROR in Error: Illegal state: symbol without members expected, but got {"filePath":"C:/Development/Intens.eCall/trunk/Intens.eCall.Website/src/app/shared/models/roles.enum.ts","name":"Role","members":["eCallUserAdministrator"]}.
at StaticSymbol.assertNoMembers (C:\Development\Intens.eCall\trunk\Intens.eCall.Website\node_modules\@angular\compiler\bundles\compiler.umd.js:794:19)
...
at enum:
export enum Role {
eCallUserAdministrator,
MSD,
IVS,
PSAP
}
@Sky4CE No I din't, but this is huge problem for me. I have over 100 containers and component in each lazy loaded module. Aliases in NgModule seems horrible solution. Currently I am not building as AOT, but will need to do something in next month, if @hansl doesn't fix this.
Please, let me know if you found any solution.
If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)
Activity
MaklaCof commentedon May 30, 2017
If it helps I experience another interesting error inside nested lazy module.
Components.ts:
mscudlik commentedon Jul 18, 2017
same issue here using constants like
provided by a shared "util" module and used in various (lazy-loaded) modules, including routing modules
sherlock1982 commentedon Jul 21, 2017
Is it the same?
Error: Illegal state: symbol without members expected, but got {"filePath":"skipped/call-history/data/call-history-type.ts","name":"CallHistoryType","members":["AllCalls"]}.
And callhistory-type.ts contains:
Appeared when I moved from 4.1.3 to 4.3.1
With 4.2.6 it compiles
mscudlik commentedon Jul 22, 2017
@sherlock1982: yes, i think so, i had/have the same issue after upgrading from 4.1.3 to 4.3
rafiwardak2003 commentedon Jul 28, 2017
I tried upgrading from 4.1.3 to 4.3.2, and got this issue. I had to go back to 4.1.3. Mine is caused by re-exporting Enums, but I assume that's the first stop, and then it will complain about all re-exports.
https://github.com/angular/angular-cli/issues/6443
brentwilton commentedon Aug 11, 2017
We have the same issue in Angular 4.3.3 when using enums in our NgModule Route data.
note: the following code compiles in AoT but leaves nulls in the route data, (as pointed out by @mattscu) and not the actual enum value.
AoT compiles but does not work
mscudlik commentedon Aug 11, 2017
@brentwilton: tried your solution and it compiled with aot, but unfortunately the compiled code had null values while the non aot code worked - so the workaround didn't really work for me :(
(i' not using enums but constants like mentioned above)
tried angular-cli 1.27 and the new 1.3.0 but both didnt work
junglebarry commentedon Aug 20, 2017
I may be confusing things here, but is this related to angular/angular#18170?
GeorgeKnap commentedon Sep 29, 2017
just getting this error during CLI AOT prod build.
at enum:
packages:
edit:
I've managed to isolate the problem to a routing module where this enum was used as a route data parameter:
removing the enum from this file and replacing enum values with numbers fixed the AOT error.
marioese commentedon Oct 12, 2017
I ran into the exact same problem today, while passing an enum value as route data (similar to what @GeorgeKnap described).
My route example:
{ path: "item/:itemId", component: ItemComponent, data: { foo: someEnum.EnumValueX } }My enum example:
In my case however, I managed to get this working by removing the 0 value from my enum:
First example fails in AOT build, while the second one succeeds. Though this may not be a solution for everyone, it might be good to know!
Vladimex commentedon Oct 20, 2017
The same problem with enums in my project. Version: 4.4.6
Will it be fixed or I have to remove all enums from the project?
MaklaCof commentedon Oct 25, 2017
@hansl Any progress? It's 5 months. I just upgraded to
angular 4.4.6andangular CLI 1.4.9. The error is still raised.I have over 300 components and it is becoming a real mess because I can not nest imports into NgModule.
I would really like to do it this way:
and not this:
Sky4CE commentedon Nov 21, 2017
@MaklaCof , I have same project structure with imports as you have (your Containers), have you manage to work with AOT ?
MaklaCof commentedon Nov 22, 2017
@Sky4CE No I din't, but this is huge problem for me. I have over 100 containers and component in each lazy loaded module. Aliases in NgModule seems horrible solution. Currently I am not building as AOT, but will need to do something in next month, if @hansl doesn't fix this.
Please, let me know if you found any solution.
mgechev commentedon Dec 18, 2018
Can you still reproduce it with the latest CLI?
MaklaCof commentedon Dec 18, 2018
I am not sure. I restructure my entire project. I couldn't live with that.
mgechev commentedon Dec 21, 2018
If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)
angular-automatic-lock-bot commentedon Sep 9, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.