You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
angular 6+ app using ionic. server side rendering error:
document.addEventListener('deviceready', function () {
^
ReferenceError: document is not defined
at checkReady (D:\www\ionic\v4\test5\www\server.js:140566:5)
at Object.<anonymous> (D:\www\ionic\v4\test5\www\server.js:140548:62)
at __webpack_require__ (D:\www\ionic\v4\test5\www\server.js:29:30)
at Object.<anonymous> (D:\www\ionic\v4\test5\www\server.js:140458:76)
at __webpack_require__ (D:\www\ionic\v4\test5\www\server.js:29:30)
at Object.@ionic-native/splash-screen/ngx (D:\www\ionic\v4\test5\www\server.js:128188:18)
at __webpack_require__ (D:\www\ionic\v4\test5\www\server.js:127618:30)
at Object../src/app/app.component.ts (D:\www\ionic\v4\test5\www\server.js:127749:13)
at __webpack_require__ (D:\www\ionic\v4\test5\www\server.js:127618:30)
at Object../src/app/app.server.module.ngfactory.js (D:\www\ionic\v4\test5\www\server.js:127809:10)
after some research, i found that the reason is that using ionic-native.
for example : import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx';
so maybe we must detect the isplatformbrowser("browser") and is platformserver('server') must be used in somewhere , how we do something like this?
thanks
The text was updated successfully, but these errors were encountered:
Bug Report
Ionic Info
Run
ionic info
from a terminal/cmd prompt and paste the output below.Describe the Bug
angular 6+ app using ionic. server side rendering error:
after some research, i found that the reason is that using ionic-native.
for example :
import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx';
so maybe we must detect the isplatformbrowser("browser") and is platformserver('server') must be used in somewhere , how we do something like this?
thanks
The text was updated successfully, but these errors were encountered: