Server Side Rendering not supported
Hi I am trying to add SSR feature with Angular Universal to project when trying to prerender below error emitted
E:\vugar\ESAS\node_modules\ng-snotify\index.js:1
(function (exports, require, module, __filename, __dirname) { import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Injectable, Input, NgModule, Output, Pipe, ViewEncapsulation } from '@angular/core';
^
SyntaxError: Unexpected token {
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:670:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
<ng-snotify></ng-snotify> is included in app.component.html.
"ng-snotify": "^4.3.1",
"@angular/core": "^6.0.3",
Can you please fix this issue? It does not allow server side rendering.
Kind Regards
I have the same problem did you ever find a solution?
.../node_modules/ng-snotify/index.js:1
(function (exports, require, module, __filename, __dirname) { import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Injectable, Input, NgModule, Output, Pipe, ViewEncapsulation } from '@angular/core'; ^^^^^^ SyntaxError: Unexpected token import
@ohabash Unfortunately not. It is library issue. I just switched the library. Or you can fork and edit the library code.
Well it works on angular maybe we can skip this module some how on the server. I’ll post the solution if it works
@ohabash Unfortunately not. It is library issue. I just switched the library. Or you can fork and edit the library code.
Can you please share the library you switched to