Topic: Failed to load resource when upgrading project from 4.2.0 to 4.3.0

roydictus pro asked 7 years ago


Using the latest version 4.3.0, Angular CLI 1.0.0, TypeScript 2.2.2When my page contains ng2-completer, I get this error when serving the page:Failed to load resource: the server responded with a status of 404 (Not Found)The resource that is not found is :4200/completer-list-item.component.html.My pages were written using versions 4.1.0 and 4.2.0, now migrated to 4.3.0.The code that uses the directive contains the following HTML:... <ul class=\"navbar-nav mr-auto\"> <liclass=\"nav-item active\"> <divclass=\"md-form\"> <ng2-completer [label]=\"State\"name=\"autocomplete\" [(ngModel)]=\"state\" [datasource]=\"states\" [minSearchLength]=\"0\"></ng2-completer> </div> </li> </ul> ... I have no idea how to resolve this; this was working fine under 4.2.0...  

Dawid Adach pro answered 7 years ago


Dear , we have just released bugfix which was breaking production build. Please download the newest package. Kind regards, Dawid

Łukasz Salamon pro commented 7 years ago

awesome. Thanks :)

Adrian Sawicki free answered 7 years ago


We are making quite a lot of updates recently. Now we will focus and keeping it stable so there won't be such problems again. Thanks for the solution.

roydictus pro commented 7 years ago

I'm not sure if it is really a solution, but it will do for now, thanks.

stalis pro answered 7 years ago


I am having the problem but fixed by using
import { MDBBootstrapModulePro } from '../typescripts/pro';
instead of
import { MDBBootstrapModulePro } from '../angular-bootstrap-md/pro';
Please, can I ask why? As far as I know '../angular-bootstrap-md/pro' is the compiled code (JS) and it should work. This was working in version 4.2.0 until now.

Magdalena Obalska free answered 7 years ago


Hi, please, download the new package from your profile and compare it to yours. It's also necessary to update the component's selectors, so look at the new documentation. Let us know if it works.

roydictus pro commented 7 years ago

Thank you, but unfortunately it is still the same problem: Failed to load resource: the server responded with a status of 404 (Not Found). The error appears in Zone.js when trying to load :4200/completer-list-item.component.html.

roydictus pro commented 7 years ago

When I build using ng build, I get no build errors. When I build using ng build --prod, I get the following build errors: ERROR in ENOENT: no such file or directory, open 'D:\Local\mdb-angular-pro-4.3.1\src\app\angular-bootstrap-md\pro\autocomplete\components\completer-list-item. component.html' ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\Local\mdb-angular-pro-4.3.1\src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts But anyway, when serving using ng serve, and surfing to my page, I always get the error that Zone.js could not load the resource (see below). 4.3.1 does not resolve this issue, unfortunately.

riccy pro commented 7 years ago

I get the same error as roydictus when using "ng build --prod". Using "ng build -prod -aot=false" works. But I would be happier if I could use aot.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags