ihym / ngx-card

Angular 2+ wrapper for https://github.com/jessepollak/card
MIT License
74 stars 34 forks source link

Angular 5 Universal server render problem #11

Open necipsunmaz opened 6 years ago

necipsunmaz commented 6 years ago

PS C:\my-path\angular-universal> node dist/server.js C:\my-path\angular-universal\node_modules\ngx-card\card.js:1 (function (exports, require, module, filename, dirname) { import { Directive, Input, ContentChildren, ElementRef } 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:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (C:\my-path\angular-universal\dist\server.js:1:1302699)

I am trying to run Server.js, but card.js gives me this error. How can I fix this problem?

document: https://medium.com/@evertonrobertoauler/angular-5-universal-with-transfer-state-using-angular-cli-19fe1e1d352c

MehmetSert commented 5 years ago

PS C:\my-path\angular-universal> node dist/server.js C:\my-path\angular-universal\node_modules\ngx-card\card.js:1 (function (exports, require, module, filename, dirname) { import { Directive, Input, ContentChildren, ElementRef } 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:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (C:\my-path\angular-universal\dist\server.js:1:1302699)

I am trying to run Server.js, but card.js gives me this error. How can I fix this problem?

document: https://medium.com/@evertonrobertoauler/angular-5-universal-with-transfer-state-using-angular-cli-19fe1e1d352c

I have the same problem. Did you find the solution?

necipsunmaz commented 5 years ago

PS C:\my-path\angular-universal> node dist/server.js C:\my-path\angular-universal\node_modules\ngx-card\card.js:1 (function (exports, require, module, filename, dirname) { import { Directive, Input, ContentChildren, ElementRef } 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:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (C:\my-path\angular-universal\dist\server.js:1:1302699) I am trying to run Server.js, but card.js gives me this error. How can I fix this problem? document: https://medium.com/@evertonrobertoauler/angular-5-universal-with-transfer-state-using-angular-cli-19fe1e1d352c

I have the same problem. Did you find the solution?

No, but i solved this problem with Google Chrome Rendertron. I advise.

MehmetSert commented 5 years ago

Thank you. I will examine.