Ngx-bootstrap: modal.js 404 (Not Found)

Created on 27 Jul 2017  路  11Comments  路  Source: valor-software/ngx-bootstrap

When i try to use BsModalService in my component, i get this error
/node_modules/ngx-bootstrap/modal.js 404 (Not Found)

portion of systemjs.config is:
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
map: {
'moment': 'npm:/moment',
'ngx-bootstrap': 'npm:ngx-bootstrap'
},
packages: {
'ngx-bootstrap': {
format: 'cjs',
main: 'bundles/ngx-bootstrap.umd.js',
defaultExtension: 'js'
},
'moment': {
main: 'moment.js',
defaultExtension: 'js'
},
}

and app.module
import { CollapseModule } from 'ngx-bootstrap';
import { ModalModule } from 'ngx-bootstrap';

imports: [
    CollapseModule.forRoot(),
    ModalModule.forRoot()
],

and in the component

import { BsModalService } from "ngx-bootstrap/modal";
constructor(private modalService: BsModalService) { }

Any Help.

comp(modal)

Most helpful comment

Fix will be released tomorrow

All 11 comments

replace with import { BsModalService } from "ngx-bootstrap";

@valorkin
when i do this, this error appears: /node_modules/ngx-bootstrap/index"' has no exported member 'BsModalService'.

Are you using v1.8.1?

Sorry 1.8.0?

Yes im using 1.8.0
snippet from package.json:
"dependencies": {
"ngx-bootstrap": "^1.8.0"
}

This is so wrong, because it is exported

no it is not, check index.ts in the ngx-bootstrap/src/ folder in the repository, you won't find it !

Yes, you are right. Seems I was looking in wrong file, sorry.
https://github.com/valor-software/ngx-bootstrap/blob/development/src/index.ts

Fix will be released tomorrow

Thanks for you.

I'm using "ngx-bootstrap": "^2.0.3", and got this error.
GET http://localhost:64652/node_modules/ngx-bootstrap/modal.js 404 (Not Found)

System Config 
Map:
          'moment': 'npm:/moment',
          "ngx-bootstrap": "node_modules/ngx-bootstrap",
Packages:
 'ngx-bootstrap': { format: 'cjs', main: 'bundles/ngx-bootstrap.umd.js', defaultExtension: 'js' },
        'moment': {
            main: 'moment.js',
            defaultExtension: 'js'
        },

app.module.ts
import { ModalModule } from 'ngx-bootstrap';

@NgModule
imports: [...,..,.. ModalModule.forRoot()]

This happens when inject the modalService in constructor.

constructor(private lookupService: LookupService
, private modalService: BsModalService) {

Am I doing anything wrong?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

srjkrl20011991 picture srjkrl20011991  路  3Comments

haisaco picture haisaco  路  3Comments

tpiros picture tpiros  路  3Comments

Scooviese picture Scooviese  路  3Comments

hugonne picture hugonne  路  3Comments