ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

Module not found after update to v11

Open MPapini91 opened this issue 3 years ago • 22 comments

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

MPapini91 avatar Jul 11 '23 12:07 MPapini91

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

swapnil0545 avatar Jul 11 '23 12:07 swapnil0545

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 :(

ELHARROUCHI avatar Jul 11 '23 12:07 ELHARROUCHI

Same here.

riiight avatar Jul 11 '23 13:07 riiight

Same issue here

cgcdoss avatar Jul 11 '23 14:07 cgcdoss

same here

mrjohnr avatar Jul 11 '23 18:07 mrjohnr

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.

JasonWeinzierl avatar Jul 12 '23 04:07 JasonWeinzierl

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?

swapnil0545 avatar Jul 12 '23 06:07 swapnil0545

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

omarrezk98 avatar Jul 12 '23 07:07 omarrezk98

#6599

MPruntel avatar Jul 12 '23 08:07 MPruntel

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

tstaals avatar Jul 12 '23 09:07 tstaals

Same issue here.

kevinlinar avatar Jul 12 '23 22:07 kevinlinar

Same

malcomm avatar Jul 12 '23 22:07 malcomm

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.

orlandoburli avatar Jul 13 '23 06:07 orlandoburli

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

kevinlinar avatar Jul 13 '23 21:07 kevinlinar

I've updated to 11.0.1 but the same problem

mrjohnr avatar Jul 13 '23 22:07 mrjohnr

I've updated to 11.0.1 but the same problem

omarrezk98 avatar Jul 13 '23 22:07 omarrezk98

finally, found it

valorkin avatar Jul 13 '23 23:07 valorkin

v11.0.2 works for me, please try

valorkin avatar Jul 14 '23 00:07 valorkin

v11.0.2 funciona para mí, intente

Perfect.

kevinlinar avatar Jul 14 '23 00:07 kevinlinar

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)

wojciechpolak avatar Jul 14 '23 06:07 wojciechpolak