aspnetcore-angular-universal icon indicating copy to clipboard operation
aspnetcore-angular-universal copied to clipboard

ngx-bootstrap aot error

Open borgotecnologia opened this issue 9 years ago • 15 comments

I've tried to build aot version with that component:

 "@angular/animations": "4.2.2",
    "@angular/common": "4.2.2",
    "@angular/compiler": "4.2.2",
    "@angular/compiler-cli": "4.2.2",
    "@angular/core": "4.2.2",
    "@angular/forms": "4.2.2",
    "@angular/http": "4.2.2",
    "@angular/platform-browser": "4.2.2",
    "@angular/platform-browser-dynamic": "4.2.2",
    "@angular/platform-server": "4.2.2",
    "@angular/router": "4.2.2",
    "@types/node": "8.0.0",
   "ngx-bootstrap": "^1.7.1",

but there are something wrong, I've received that message:

 ERROR in ./Client/ngfactory/~/ngx-bootstrap/modal/modal-backdrop.component.ngfactory.ts
    Module parse failed: S:\EMPREGOS\Core\Universal_Bacon\Angular_File_by_File\Client\ngfactory\node_modules\ngx-bootstrap\modal\modal-backdrop.component.ngfactory.ts Unexpected token (12:35)
    You may need an appropriate loader to handle this file type.
    | import * as i1 from './modal-backdrop.component.ngfactory';
    | import * as i2 from 'ngx-bootstrap/modal/modal-backdrop.component';
    | const styles_ModalBackdropComponent:any[] = ([] as any[]);
    | export const RenderType_ModalBackdropComponent:i0.RendererType2 = i0.ɵcrt({encapsulation:2,
    |     styles:styles_ModalBackdropComponent,data:{}});
     @ ./Client/ngfactory/app/server-app.module.ngfactory.ts 10:0-93
     @ ./Client/main.server.aot.ts

    ERROR in ./Client/ngfactory/~/ngx-bootstrap/Typeahead/typeahead-container.component.ngfactory.ts
    Module parse failed: S:\EMPREGOS\Core\Universal_Bacon\Angular_File_by_File\Client\ngfactory\node_modules\ngx-bootstrap\Typeahead\typeahead-container.component.ngfactory.ts Unexpected token (13
:40)
    You may need an appropriate loader to handle this file type.
    | import * as i2 from 'ngx-bootstrap/Typeahead/typeahead-container.component';
    | import * as i3 from './typeahead-container.component.ngfactory';
    | const styles_TypeaheadContainerComponent:any[] = ([] as any[]);
    | export const RenderType_TypeaheadContainerComponent:i0.RendererType2 = i0.ɵcrt({encapsulation:2,
    |     styles:styles_TypeaheadContainerComponent,data:{}});
     @ ./Client/ngfactory/app/server-app.module.ngfactory.ts 11:0-102
     @ ./Client/main.server.aot.ts

    ERROR in ./Client/ngfactory/~/ngx-bootstrap/typeahead/typeahead-container.component.ngfactory.ts
    Module parse failed: S:\EMPREGOS\Core\Universal_Bacon\Angular_File_by_File\Client\ngfactory\node_modules\ngx-bootstrap\typeahead\typeahead-container.component.ngfactory.ts Unexpected token (13
:40)
    You may need an appropriate loader to handle this file type.
    | import * as i2 from 'ngx-bootstrap/typeahead/typeahead-container.component';
    | import * as i3 from './typeahead-container.component.ngfactory';
    | const styles_TypeaheadContainerComponent:any[] = ([] as any[]);
    | export const RenderType_TypeaheadContainerComponent:i0.RendererType2 = i0.ɵcrt({encapsulation:2,
    |     styles:styles_TypeaheadContainerComponent,data:{}});
     @ ./Client/ngfactory/app/server-app.module.ngfactory.ts 14:0-102
     @ ./Client/main.server.aot.ts

Whats wrong? Do I need to put anything else in webpack?

borgotecnologia avatar Jun 19 '17 17:06 borgotecnologia

Is this from a fresh repo pulldown? I didn't get any errors when running an AoT build. Do you have any code example we can look at? Let me know!

MarkPieszak avatar Jun 22 '17 16:06 MarkPieszak

When running ng build, it doesn't return any errors and it works online. However, when running with ng build --prod I get a bunch of errors and it wont work online. WARNING in ./src/$$_gendir/app/users/login/user.login.component.ngfactory.ts 54:27-32 "export 'ɵa' (imported as 'i5') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/app/users/login/user.login.component.ngfactory.ts 54:34-39 "export 'ɵa' (imported as 'i5') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/app/users/login/user.login.component.ngfactory.ts 54:101-106 "export 'ɵa' (imported as 'i5') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/app/users/signup/user.signup.component.ngfactory.ts 115:27-32 "export 'ɵa' (imported as 'i5') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/app/users/signup/user.signup.component.ngfactory.ts 115:34-39 "export 'ɵa' (imported as 'i5') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/app/users/signup/user.signup.component.ngfactory.ts 115:101-106 "export 'ɵa' (imported as 'i5') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/~/ngx-intl-tel-input/ngx-intl-tel-input.ngfactory.ts 206:201-206 "export 'ɵa' (imported as 'i1') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/~/ngx-intl-tel-input/ngx-intl-tel-input.ngfactory.ts 206:208-213 "export 'ɵa' (imported as 'i1') was not found in 'ngx-intl-tel-input'

WARNING in ./src/$$_gendir/~/ngx-intl-tel-input/ngx-intl-tel-input.ngfactory.ts 206:275-280 "export 'ɵa' (imported as 'i1') was not found in 'ngx-intl-tel-input'

codercodingthecode avatar Aug 02 '17 05:08 codercodingthecode

Can you check ngx-bootstrap issues, this sounds like something on their end that's breaking lately

MarkPieszak avatar Aug 06 '17 16:08 MarkPieszak

I use this repo with the next version of ngx-bootstrap. Try updating your package.json to ^2.0.0-beta.2

isaacrlevin avatar Aug 06 '17 21:08 isaacrlevin

I'm having the same problem using .Net Core 2.0 with all the new template stuff (I'm also using "ngx-bootstrap": "^2.0.0-beta.2") Update (9/7/2017) - Ignore the above. This was confusion on my part. I was not using aspnetcore-angular2-universal... that's why I was having the problem. I am now moving my code to use aspnetcore-angular2-universal

ilennert avatar Aug 31 '17 04:08 ilennert

Has anyone fixed this. I'm having the same problem

aecuman avatar Sep 07 '17 09:09 aecuman

@aecuman are you doing a fresh pull of this repo with the @next version of ngx-bootstrap? What is your error?

isaacrlevin avatar Sep 07 '17 09:09 isaacrlevin

I'm sorry. It looks like a webpack problem after webpack --env.prod though i have not fixed the issue

aecuman avatar Sep 07 '17 09:09 aecuman

Please note: when I reported that I was having this problem with my code. I should not have been reporting it here. I was not at the time using this library (I am moving my code into this example template now...)

ilennert avatar Sep 07 '17 16:09 ilennert

Has anyone solved this issue and if yes how?

jcphlux avatar Sep 14 '17 04:09 jcphlux

Do you have a recent version of the repo? I believe all it takes is removing:

include: ClientApp // just remove this part so it takes in node_modules as well during AoT

from the ts rule in webpack.

MarkPieszak avatar Sep 14 '17 04:09 MarkPieszak

@jcphlux

MarkPieszak avatar Sep 14 '17 04:09 MarkPieszak

@MarkPieszak Thanks. Removing the 'include: ClientApp' did correct the error. Do you know why this was causing this issue?

jcphlux avatar Sep 25 '17 19:09 jcphlux

Hey @jcphlux, we need to make sure we AoT those files as files as well, by only having include: ClientApp we're ignoring node_modules entirely, which is what caused the issue.

Hope that helps! :)

MarkPieszak avatar Oct 01 '17 18:10 MarkPieszak

Anyone have a solution?

netbidev avatar Nov 14 '17 16:11 netbidev