ng-snotify icon indicating copy to clipboard operation
ng-snotify copied to clipboard

Server Side Rendering not supported

Open vugar005 opened this issue 7 years ago • 4 comments

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

vugar005 avatar Jul 17 '18 13:07 vugar005

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 avatar Dec 02 '18 19:12 ohabash

@ohabash Unfortunately not. It is library issue. I just switched the library. Or you can fork and edit the library code.

vugar005 avatar Dec 03 '18 06:12 vugar005

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 avatar Dec 03 '18 13:12 ohabash

@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

Saurabh11Sharma avatar May 08 '19 08:05 Saurabh11Sharma