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

404 (Not Found) (http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap) #1035

Closed
quiringk opened this issue Sep 27, 2016 · 7 comments

Comments

@quiringk
Copy link

quiringk commented Sep 27, 2016

I am upgrading from RC4 to 2.0.0 final. After fixing all the errors in my application, the only left is with ng2-bootstrap and these two lines.

Failed to load resource: the server responded with a status of 404 (Not Found) (http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap)

localhost/:32 Error: Error: XHR error (404 Not Found) loading http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap
        at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:647:29)
        at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:236:37)
        at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:136:47)
        at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:304:33)
    Error loading http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap as "ng2-bootstrap/ng2-bootstrap" from http://localhost:3000/app/app/app.module.js

Here is my app.module.ts file:

import { NgModule }       from '@angular/core';
import { BrowserModule  } from '@angular/platform-browser';
import { AppComponent }   from './app.component';

import { CoreModule }     from './core/core.module';
import { routing,
         appRoutingProviders }        from './app.routing';

import { DivisionProposalsComponent } from '../division-proposals/division-proposals.component/division-proposals.component';
import { FilterProposalsComponent } from '../division-proposals/division-proposals.component/filter-proposals.component/filter-proposals.component';

import { DivisionProposalsService } from '../division-proposals/division-proposals.service/division-proposals.service'

import { Ng2BootstrapModule } from 'ng2-bootstrap/ng2-bootstrap';

@NgModule({
    imports: [
        BrowserModule,
        Ng2BootstrapModule,
        CoreModule,
        routing,
    ],
    declarations: [
        AppComponent,
        DivisionProposalsComponent,
        FilterProposalsComponent,
    ],
    providers: [
        appRoutingProviders,
        DivisionProposalsService
    ],
    bootstrap:    [AppComponent],
})
export class AppModule {}

I initially changed all my ng2-bootstrap import statements in my components from Component -> Module. But with Ng2BootstrapModule imported in app.module.ts, do I even need import statements in child components where I use ng2-bootstrap components? I feel like I am reading conflicting statements and am unsure how get rid of this error.

@Martin-Luft
Copy link
Contributor

Did you read this issues?

#954
#945
#790
#704
#634
#607
#257
#88
#50

@quiringk
Copy link
Author

Ok I got it. Adding the

'ng2-bootstrap': { defaultExtension: 'js' },

to the packages list in systemjs.config got rid of that error. With the new release candidates systemjs.config changes a lot which has caused me headaches in the past. Now I am getting a 404 with moment which I will try and figure out

@Martin-Luft
Copy link
Contributor

I would use @types/moment: #1020

@quiringk
Copy link
Author

@Martin-Wegner Can you please elaborate a little more? Where do I make that change if I am using a systemjs configuration. Currently I have this in my systemjs.config file...

// other libraries 'rxjs': 'npm:rxjs', 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api', 'moment': 'npm:moment',

and adding moment to the packages list like

, 'moment': { defaultExtension: 'js' }

is not fixing the issue either.

@Martin-Luft
Copy link
Contributor

Martin-Luft commented Sep 27, 2016

@types/moment is a packages.json dependency and you don't need to use the typings command anymore to install the moments typings and also no need for the typings.json anymore if you move all typings from this file to the related @types dependencies... I don't know systemjs, sorry :(

@Martin-Luft
Copy link
Contributor

@quiringk does it work for you? Can I close this issue?

@quiringk
Copy link
Author

Yeah, to get the 404 moment error to go away with the current systemjs configuration I changed the line from

'moment': 'npm:moment',

to

'moment': 'npm:ng2-bootstrap/node_modules/moment/moment',

You can close the issue

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

2 participants