question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AOT import * error: ERROR in Illegal state: symbol without members expected, but got

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

I did and search suggested to open new issue.

Versions.

node --version: v7.10.0 npm --version: 4.2.0 window 10 - 64bit

Repro steps.

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
sherlock1982commented, 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:

export enum CallHistoryType {
    AllCalls = 0,
    Missed = 1,
    Received = 2,
    Outgoing = 3,
    Abandoned = 4
}

Appeared when I moved from 4.1.3 to 4.3.1 With 4.2.6 it compiles

3reactions
mscudlikcommented, Jul 18, 2017

same issue here using constants like

export const Constants = {
  foo = 'bar'
  // ...
};

provided by a shared “util” module and used in various (lazy-loaded) modules, including routing modules

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Angular4 Prod Build Error - Stack Overflow
ERROR in Illegal state: symbol without members expected, but got {"filePath":"D:/Projects/app/node_modules/@angular/platform-browser/platform- ...
Read more >
angular/angular-cli - Gitter
It looks like my problem is caused by having to import the MaterialModule into my unit test in order to get a compile...
Read more >
AOT metadata errors - Angular
The compiler encountered a referenced to a locally defined symbol that either ... ERROR export let someTemplate: string; // exported but not initialized ......
Read more >
Getting error while building angular app after installing ...
I have an Angular 5 application, in which i added the daypilot-pro-angular ... ERROR in Error: Illegal state: symbol without members expected, but...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/24 17 ...
gives confusing output regarding system state and /etc/portage settings" ... Bug:586884 - "sys-fs/xfsprogs-4.5.0: xfs_growfs: symbol lookup error: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found