Router unwraps default imports is getting error

This issue has been created since 2022-11-23.

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

I'm trying to export Support for default exports in `loadChildren things but I get an error.

{
    path: 'lazy',
    loadComponent: () => import('./app/lazy/lazy.component'),
}

error:
Type '() => Promise<typeof import("c:/Users/taner/OneDrive/Masa\u00FCst\u00FC/E\u011Fitim Videolar\u0131/Angular 15/Belgeler/my-app/src/app/lazy/lazy.component")>' is not assignable to type '() => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>'. Type 'Promise<typeof import("c:/Users/taner/OneDrive/Masa\u00FCst\u00FC/E\u011Fitim Videolar\u0131/Angular 15/Belgeler/my-app/src/app/lazy/lazy.component")>' is not assignable to type 'Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>'. Type 'Promise<typeof import("c:/Users/taner/OneDrive/Masa\u00FCst\u00FC/E\u011Fitim Videolar\u0131/Angular 15/Belgeler/my-app/src/app/lazy/lazy.component")>' is not assignable to type 'Promise<Type<unknown> | DefaultExport<Type<unknown>>>'. Type 'typeof import("c:/Users/taner/OneDrive/Masa\u00FCst\u00FC/E\u011Fitim Videolar\u0131/Angular 15/Belgeler/my-app/src/app/lazy/lazy.component")' is not assignable to type 'Type<unknown> | DefaultExport<Type<unknown>>'.ts(2322) index.d.ts(2351, 5): The expected type comes from property 'loadComponent' which is declared here on type 'Route'

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

JoostK wrote this answer on 2022-11-23

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem still exists in your application, please open a new issue and follow the instructions in the issue template.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-12-01
Star Count 85220
Watcher Count 3042
Fork Count 22607
Issue Count 1316

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Linux NVENC (Kepler): "no kernel image is available for execution on the device" 1 2022-07-09 2022-08-06
[Bug] Unstable PH/PS fast mode 1 2021-11-22 2022-10-10
Build: API that generates dataset for a SaaS application 0 2022-09-20 2022-11-15
= sign in variables does not work 1 2022-10-11 2022-11-19
Make information about the state of the distributed network available 0 2021-12-26 2022-08-03
Samples format when channels>2. 2 2021-08-28 2022-05-09
Adding in a new column in csv for custom settings 4 2022-01-24 2022-11-08
Multiple list does not send NULL 1 2019-12-10 2022-11-01
First Custom Item in Panel Icon dropdown doesn't work 10 2022-06-25 2022-11-22
Expanded subfolders aren't saved across restarts 5 2022-06-18 2022-11-22
about physics mode Darcy's law 0 2021-12-23 2022-01-01
Hand over face (High Resolution Masks) 11 2020-09-18 2022-10-09
Would you please specify your dataset license? 1 2021-07-12 2022-11-22
How to train on my own datasets? 2 2018-07-04 2022-08-06
[FEATURE REQUEST] Add "All books" section 0 2021-01-29 2022-10-19
Bitfinex usd perps under UST 1 2022-05-10 2022-11-21
Default value for unset signals or unused bits in the frame should be '1' for J1939 0 2021-06-23 2022-09-21
Errors loading database 1 2018-06-23 2022-11-16
Logging further variables (e.g. reactive variables defined in the server part) 1 2021-09-27 2022-11-12
[FEATURE] Type Display notification types in ReferenceID 3 2022-02-07 2022-10-07
[Feature Request] Support Inline HTML Rendering under test information 9 2021-10-12 2022-11-23
Cannot read property of 'location '...undefined 1 2021-07-14 2022-11-17
[self-tests] tests based on threadpoolctl fail on ppc64le 0 2022-03-03 2022-11-18
Problem using RDatasets in Notebook 1 2021-09-20 2022-10-22
Shouldn't we check if complete message was downloaded? 0 2021-01-28 2022-11-29
Hover functionality in histograms 1 2021-07-01 2022-11-22
`pnpm install-completion` on Windows writes invalid `.bashrc` lines -- slashes are not escaped 0 2022-09-28 2022-10-26
Docs: Gitpod and Business Continuity (Concepts & Background section) 0 2022-06-08 2022-09-30
Swagger UI's stylesheets aren't loaded 4 2021-11-22 2022-10-13
[BUG] Several Black Rectangles Appearing 5 2020-12-07 2022-11-03
Virtual background images do not load and result in a white screen 6 2022-03-23 2022-11-03
-Warray_bounds warning 0 2021-11-09 2022-11-01
Support for system media events 5 2022-04-15 2022-11-29
Document changes with Dynamic permissions 0 2022-08-21 2022-11-29
How can I add multiple no-result sections 1 2021-06-23 2022-10-23
Update of exiting OE fails, adding a new OE fails 2 2021-01-17 2022-10-13
test/plugins/test_folding.py fails: extra range produced 5 2020-12-28 2022-11-22
Is there any guide for integrating react-codemirror2 into NextJs? 1 2022-08-23 2022-11-19
Are SQL Triggers possible 4 2021-03-13 2021-11-20
Remove the broken iconUrl from the chocolatey spec 0 2020-01-27 2022-11-13
Filtering on codec type in a datastore 3 2022-04-22 2022-11-27
Missing author 2 2021-09-22 2021-12-27
WSL No Longer Starts because the "host failed to respond" 2 2021-08-22 2022-10-26
Why not `Window::set_*_callback`? 3 2022-01-02 2022-11-15
Sorting of events with identical start date&time 3 2021-07-17 2022-10-02
USB drive unusable after incomplete Rufus session 2 2022-02-19 2022-11-25
[unreal]请问有没有一键编译(ts->js)的功能 4 2022-01-06 2022-09-30
[Listing Error] Calibration Companion 1 2021-05-12 2022-11-22
Bitmap fontpatcher down 1 2020-10-23 2022-11-25
[libraries-pgo] NRE in System.Text.Json.Serialization.Tests.TypeInfoResolverFunctionalTests.DoNotSerializeValue42 6 2022-07-25 2022-10-09