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

modal.js 404 (Not Found) #2291

Closed
MostafaAbdlrazek opened this issue Jul 27, 2017 · 11 comments
Closed

modal.js 404 (Not Found) #2291

MostafaAbdlrazek opened this issue Jul 27, 2017 · 11 comments
Assignees
Milestone

Comments

@MostafaAbdlrazek
Copy link

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.

@valorkin
Copy link
Member

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

@MostafaAbdlrazek
Copy link
Author

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

@valorkin
Copy link
Member

Are you using v1.8.1?

@valorkin
Copy link
Member

Sorry 1.8.0?

@MostafaAbdlrazek
Copy link
Author

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

@valorkin
Copy link
Member

This is so wrong, because it is exported

@MostafaAbdlrazek
Copy link
Author

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

@valorkin
Copy link
Member

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

@valorkin valorkin reopened this Jul 27, 2017
@valorkin valorkin self-assigned this Jul 27, 2017
@valorkin valorkin added this to the v1.8.1 milestone Jul 27, 2017
@valorkin
Copy link
Member

Fix will be released tomorrow

@MostafaAbdlrazek
Copy link
Author

Thanks for you.

@RoccoSen
Copy link

RoccoSen commented Mar 19, 2018

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?

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

No branches or pull requests

3 participants