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

Adding ng bootstrap for twitter bootstrap cause failure to build nom start #1

Closed
PSPanesar opened this issue May 21, 2017 · 6 comments

Comments

@PSPanesar
Copy link

Hi,
Thanks for the tutorial. I've setup the same steps for my angular 4 app which works fine but when i add ng-bootstrap with npm install --save @ng-bootstrap/ng-bootstrap then import it to my module with import {NgbModule} from '@ng-bootstrap/ng-bootstrap and imports: [NgbModule.forRoot()] then the whole app fails to compile with npm start or production build. Could you help and let me know what is going wrong?
Thanks

@nomanHasan
Copy link

nomanHasan commented May 24, 2017

I'm facing the same issue here, importing Material Module produces this error -

dist\ngfactory\node_modules\@angular\material\typings\index.ngfactory.ts:9
import * as import0 from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Module._extensions..js (module.js:580:10)

Or After importing the NgxBootstrap This error -

(function (exports, require, module, __filename, __dirname) { import { NgModule } from '@angular/core';
                                                          ^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)

I'm guessing this issue is for all imports of third party modules.

@deepakzoto
Copy link

I am also getting the same error. Any solution to this problem?

@Shyam-Chen
Copy link

.../dist/ngfactory/node_modules/@angular/material/typings/index.ngfactory.ts:9
import * as i0 from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import

@wnabil
Copy link

wnabil commented Jul 2, 2017

the problem is the js es5 as i see on stackoverflow.
so we need to change the target to es6 then use the babel js to convert it because the express engine only supports es5
so the question is how to use babel with angular cli !?

@wnabil
Copy link

wnabil commented Jul 6, 2017

maybe this will help someone :
#3 (comment)
i tested it with ng-bootstrap and it works

@ali-habibzadeh
Copy link

Same problem here

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

6 participants