Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found after update to v11 #6596

Closed
MPapini91 opened this issue Jul 11, 2023 · 22 comments
Closed

Module not found after update to v11 #6596

MPapini91 opened this issue Jul 11, 2023 · 22 comments

Comments

@MPapini91
Copy link

MPapini91 commented Jul 11, 2023

After updating to v.11 I can't serve my project, getting "Failed to compile". For every module I get a message like:
Module not found: Error: Can't resolve 'ngx-bootstrap/modal'.
I'm using a module for importing ngx-bootstrap components:

@NgModule({
  declarations: [],
  imports: [
    AlertModule.forRoot(),
    BsDropdownModule.forRoot(),
    ModalModule.forRoot(),
    TabsModule.forRoot(),
    TooltipModule.forRoot(),
    AccordionModule.forRoot(),
    RatingModule.forRoot(),
    TypeaheadModule.forRoot(),
    PaginationModule.forRoot(),
    ProgressbarModule.forRoot()
  ],
  exports: [
    AlertModule,
    BsDropdownModule,
    ModalModule,
    TabsModule,
    TooltipModule,
    AccordionModule,
    RatingModule,
    TypeaheadModule,
    PaginationModule,
    ProgressbarModule
  ]
})
export class BootstrapImportModule { }

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 11.0.0

Angular: 16

Bootstrap: 5.2.3

@swapnil0545
Copy link

Facing same issues. Was about to raise the same issue.

@ELHARROUCHI
Copy link

After updating to v.11 I can't serve my project, getting "Failed to compile". For every module I get a message like: Module not found: Error: Can't resolve 'ngx-bootstrap/modal'. I'm using a module for importing ngx-bootstrap components:

@NgModule({
  declarations: [],
  imports: [
    AlertModule.forRoot(),
    BsDropdownModule.forRoot(),
    ModalModule.forRoot(),
    TabsModule.forRoot(),
    TooltipModule.forRoot(),
    AccordionModule.forRoot(),
    RatingModule.forRoot(),
    TypeaheadModule.forRoot(),
    PaginationModule.forRoot(),
    ProgressbarModule.forRoot()
  ],
  exports: [
    AlertModule,
    BsDropdownModule,
    ModalModule,
    TabsModule,
    TooltipModule,
    AccordionModule,
    RatingModule,
    TypeaheadModule,
    PaginationModule,
    ProgressbarModule
  ]
})
export class BootstrapImportModule { }

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 11.0.0

Angular: 16

Bootstrap: 5.2.3

the same :(

@riiight
Copy link

riiight commented Jul 11, 2023

Same here.

@cgcdoss
Copy link

cgcdoss commented Jul 11, 2023

Same issue here

@mrjohnr
Copy link

mrjohnr commented Jul 11, 2023

same here

@JasonWeinzierl
Copy link

There's something wrong with the "exports" paths in node_modules/ngx-bootstrap/package.json. They seem to be pointing to folders which don't exist.

I was able to fix it locally by find-and-replacing fesm2020 with fesm2022.

@swapnil0545
Copy link

Thanks @JasonWeinzierl I was not knowing much about these things. Was wondering about same until I found your comment and this reference for docs
https://angular.io/guide/angular-package-format
Is anyone working on a PR or raised any?

@omarrezk98
Copy link

Facing same issues. Was about to raise the same issue.

@MPruntel
Copy link
Contributor

#6599

@tstaals
Copy link

tstaals commented Jul 12, 2023

We face the same issue, and really need a fix, locally we can rename, but not in our build pipelines

@kevinlinar
Copy link

Same issue here.

@malcomm
Copy link

malcomm commented Jul 12, 2023

Same

@orlandoburli
Copy link

orlandoburli commented Jul 13, 2023

There's something wrong with the "exports" paths in node_modules/ngx-bootstrap/package.json. They seem to be pointing to folders which don't exist.

I was able to fix it locally by find-and-replacing fesm2020 with fesm2022.

This fix works for me. Also there is the PR #6599 to fix it.

@kevinlinar
Copy link

This issue was closed, but I still have the same problem. Any recommendations?

@mrjohnr
Copy link

mrjohnr commented Jul 13, 2023

I've updated to 11.0.1 but the same problem

1 similar comment
@omarrezk98
Copy link

I've updated to 11.0.1 but the same problem

@valorkin
Copy link
Member

finally, found it

@valorkin
Copy link
Member

v11.0.2 works for me, please try

@kevinlinar
Copy link

v11.0.2 funciona para mí, intente

Perfect.

@wojciechpolak
Copy link

Unfortunately, v11.0.2 doesn't yet fully solve the problem.

14 07 2023 08:21:49.963:INFO [karma-server]: Karma v6.4.1 server started at http://localhost:9876/
14 07 2023 08:21:49.967:INFO [launcher]: Launching browsers ChromeHeadlessCustom with concurrency unlimited
14 07 2023 08:21:49.972:INFO [launcher]: Starting browser ChromeHeadless
14 07 2023 08:21:50.487:INFO [Chrome Headless 114.0.5735.133 (Linux x86_64)]: Connected on socket v_CBf7CMwfnW3AtKAAAB with id 91243169
Chrome Headless 114.0.5735.133 (Linux x86_64) ERROR
Uncaught Error: Cannot find module 'ngx-bootstrap/modal'
at http://localhost:9876/_karma_webpack_/main.js:114104:50

Error: Cannot find module 'ngx-bootstrap/modal'
at webpackMissingModule (http://localhost:9876/_karma_webpack_/main.js:114104:50)
at Module.78105 (http://localhost:9876/_karma_webpack_/main.js:114104:144)
at webpack_require (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:19:1)
at Module.23475 (http://localhost:9876/_karma_webpack_/main.js:115209:80)
at webpack_require (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:19:1)
at Module.53745 (http://localhost:9876/_karma_webpack_/main.js:115546:84)
at webpack_require (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:19:1)
at Module.63708 (http://localhost:9876/_karma_webpack_/main.js:108525:88)
at webpack_require (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:19:1)
at Module.51499 (http://localhost:9876/_karma_webpack_/main.js:102824:79)

ngx-bootstrap: 11.0.2
angular: 16.1

(there is no problem with ngx-bootstrap v9.0.0 from which I try to upgrade)

@valorkin
Copy link
Member

@wojciechpolak I don't use Karma for a while, please create a small repo to reproduce issue

@wojciechpolak
Copy link

Ok, I was able to solve it. A small change is tsconfig.json for "module" from es2020 to es2022 did the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests