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.

Lazy-loaded routing pages do not generate declarations in `auto-imports.d.ts`

See original GitHub issue

The type declaration is generated in auto-imports.d.ts only when it needs to be loaded into a lazy-loaded routing page.

The auto-imports.d.ts file is reset every time the project is built; if the lazy loading page is not loaded, the auto-imports declaration will not be generated, and the project file will indicate that the module cannot be found at this time

reproduction project: https://stackblitz.com/github/Mrlilili/auto-import-test?file=src/typings/auto-imports.d.ts

https://user-images.githubusercontent.com/8361655/179142755-ee045cac-d146-434f-a6fe-adf5cde92982.mov

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
zq0904commented, Jul 24, 2022

Have the same problem

My scenario is some pages with manual import API and some pages without manual import Vue-tsc --noEmit failed directly when I built because auto-imports. D. ts doesn’t have this API

Because performance considerations are the result? I really wish the auto-imports. D. ts generation rule would provide a configuration item for the user to decide if it is full

At the moment I have to agree on my own rules of use: either no manual import at all or manual import of all pages

I look forward to your solution

0reactions
ll60commented, Sep 16, 2022

same problem, i decide to to manual manage *.d.ts, not use auto generate file

项目庞大,并且是多人协作开发的时候,我无法知晓哪些已经使用过的,维护起来苦不堪言,还是需要自动生成的。

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy loading don't find the declaration of my component
ts, my component "DialogConfirmacaoExclusao" is alerted that is not part of any ngModule. I try: My app routing module: import { NgModule }...
Read more >
Lazy-loading feature modules - Angular
Create the feature module with the Angular CLI, using the --route flag. ... Because the new module is meant to be lazy-loaded, the...
Read more >
Advanced Features: Dynamic Import - Next.js
Dynamically import JavaScript modules and React Components and split your code into manageable chunks.
Read more >
Resolving errors faced while implementing Lazy Loading with ...
Check that the imported modules of a feature module is not also a lazy-loaded module with a route. Consider PreloadAllModules. Angular will ...
Read more >
How To Use Lazy Loading Routes in Angular | DigitalOcean
The following covers lazy loading modules in Angular 8+ apps. · Do not import feature modules that should be lazy-loaded in your app...
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