Skip to content

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

Description

@HoangQuan

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! demoapp@0.0.0 serve:universal: `npm run build:universal && cd dist && node server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the demoapp@0.0.0 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions