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 Compiler looks for files in wrong path

See original GitHub issue

Please provide us with the following information:

OS?

Windows 10

Versions.

ng --version (node:12872) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. angular-cli: 1.0.0-beta.10 node: 6.7.0 os: win32 x64

Repro steps.

No, but it is at https://github.com/georgeedwards/docs

  1. clone source
  2. checkout performance branch
  3. cd client
  4. ngc -p tsconfig-aot.json

The log given by the failure.

Normally this include a stack trace and some more information.

Error: Compilation failed. Resource file not found: C:/Users/George/Source/Repos/docs/client/components/home/client/components/home/home.html

Mention any other details that might be useful.

The home.html file is actually at C:/Users/George/Source/Repos/docs/client/components/home/home.html


Thanks! We’ll be in touch soon.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
skendrotcommented, Dec 13, 2016

Thanks to Visual Studio go to definition, I found that an NgModule has an id?: string property. and that the Component has a moduleId?: string property.

@NgModule({
    id: 'MyApp',
    imports: [BrowserModule],
    declarations: [AppComponent ],
    bootstrap: [AppComponent ]
})

In the Component:

@Component({
    selector: 'my-app',
    moduleId: 'MyApp',
    templateUrl: 'app.component.html',
    styleUrls: ['app.component.css']
})

Even with these changes, and adding window.module = 'aot'; to the script of the index page it still tries to get the html file relative to the host server

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngc looking in wrong directory - angular - Stack Overflow
In the component ts file you should change the 'templateUrl' to a relative path and add 'moduleId: module.id'. Example, from:
Read more >
Ahead-of-time (AOT) compilation - Angular
The compiler inlines external HTML templates and CSS style sheets within the application JavaScript, eliminating separate ajax requests for those source files.
Read more >
Compiler Options - ClojureScript
If local path is a directory instead of a file, the compiler will recursively go through all .js files within the directory and...
Read more >
AOT compilation part 1 - Halide
Halide tutorial lesson 10: AOT compilation part 1 // This lesson demonstrates ... -I <path/to/Halide.h> -L <path/to/libHalide.so> -lHalide -lpthread -ldl -o ...
Read more >
5.8. Filenames and separate compilation
The strategy for looking for source files is as follows: GHC keeps a list of directories called the search path. For each of...
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