Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 4 + Angular 7 + SSR issue on 'node dist/server'

We are in the processes of setting up a test app utilizing Ionic 4 + Angular 7 utilizing Angular Universal for SSR. Upon adding Ionic into the mix, we are getting the following error when attempting to serve the application. Are gut feeling is it has something to do with SSR, but due to limited documentation and difficulty finding an example project, we have been unable to solve this mystery.

/Users/jsmith/Documents/workspace/website2.0/node_modules/@ionic/angular/dist/fesm5.js:1
(function (exports, require, module, __filename, __dirname) { import { __extends, __awaiter, __generator, __assign } from 'tslib';
                                                                     ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
like image 737
davecalvin Avatar asked Jan 29 '19 20:01

davecalvin


2 Answers

Unfortunately, Ionic 4 doesn't support SSR yet. i.e. It has known issues.

Mike Hartington@Ionic team

SSR is still something that we intend to work on supporting, but it there are a few bigger issues that require all of our attention.

SSR Issue is here

like image 162
Sampath Avatar answered Oct 13 '22 03:10

Sampath


I think SSR support is close. Adam Bradley (co-founder and lead dev) has been working on something. Keep an eye on the git issue.

like image 42
Jai Avatar answered Oct 13 '22 02:10

Jai