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

Angular Universal Does not work with ngx-bootstrap? #5

Open
HoangQuan opened this issue Jul 12, 2018 · 2 comments
Open

Angular Universal Does not work with ngx-bootstrap? #5

HoangQuan opened this issue Jul 12, 2018 · 2 comments

Comments

@HoangQuan
Copy link

HoangQuan commented Jul 12, 2018

I got this error when tried to run my node server.js

/projects/my_project/angular/node_modules/ngx-bootstrap/modal/modal-backdrop.component.js:1
(function (exports, require, module, __filename, __dirname) { import { Component, ElementRef, Renderer2 } from '@angular/core';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.IBu+ (/projects/my_project/angular/dist/dist-server/main.bundle.js:1:272046)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve:universal: `npm run build:universal && cd dist && node server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] serve:universal script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/hoangquan/.npm/_logs/2018-07-12T04_29_25_851Z-debug.log

It's seem node does not understand import command, right?
I'm using node version v8.11.3
I did use Babel to my project too, But It does'nt help. :(
Have you any suggestions? @m98 , thanks

@sarath3940
Copy link

sarath3940 commented Nov 30, 2018

Did you find any solution?

@HoangQuan
Copy link
Author

HoangQuan commented Dec 22, 2018

@sarath3940 I didn't. because My Angular version is old one.

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