Open mkhalesi opened 3 years ago
SSR runs on the server, where navigator
and other objects (like window
) aren't available. When coding for SSR you have to make sure to check the platform before executing code that use these objects.
@Parziphal i worked based on your tips like this:
if (isPlatformBrowser(this.platformId)) {
import('device-uuid').then( module => {
const deviceId = new module.DeviceUUID().get() ;
});
}
and worked properly thanks :)
hi when run project in ssr with command : npm run dev:ssr get same error:
im using a mock browser , in server.ts file :
thanks