Skip to content

Add support for universal server side rendering #93

@dottodot

Description

@dottodot

When rendering pages server side is doesn't work. At least one issue is because of the use of MutationObserver which is browser only.

Here's the errors is causes.

ERROR ReferenceError: MutationObserver is not defined
    at CloudinaryImage.ngOnInit (/node_modules/@cloudinary/angular-4.x/src/cloudinary-image.component.js:23:29)
    at checkAndUpdateDirectiveInline (/node_modules/@angular/core/bundles/core.umd.js:10868:19)
    at checkAndUpdateNodeInline (/node_modules/@angular/core/bundles/core.umd.js:12364:17)
    at checkAndUpdateNode (/node_modules/@angular/core/bundles/core.umd.js:12303:16)
    at prodCheckAndUpdateNode (/node_modules/@angular/core/bundles/core.umd.js:12997:5)
    at Object.updateDirectives (/dist-server/main.bundle.js:1:155164)
    at Object.updateDirectives (/node_modules/@angular/core/bundles/core.umd.js:12754:72)
    at checkAndUpdateView (/node_modules/@angular/core/bundles/core.umd.js:12270:14)
    at callViewAction (/node_modules/@angular/core/bundles/core.umd.js:12635:21)
    at execComponentViewsAction (/node_modules/@angular/core/bundles/core.umd.js:12567:13)
    at checkAndUpdateView (/node_modules/@angular/core/bundles/core.umd.js:12276:5)
    at callViewAction (/node_modules/@angular/core/bundles/core.umd.js:12635:21)
    at execComponentViewsAction (/node_modules/@angular/core/bundles/core.umd.js:12567:13)
    at checkAndUpdateView (/node_modules/@angular/core/bundles/core.umd.js:12276:5)
    at callViewAction (/node_modules/@angular/core/bundles/core.umd.js:12635:21)
    at execEmbeddedViewsAction (/node_modules/@angular/core/bundles/core.umd.js:12593:17)
TypeError: Cannot read property 'disconnect' of undefined
    at CloudinaryImage.ngOnDestroy (/node_modules/@cloudinary/angular-4.x/src/cloudinary-image.component.js:32:22)
    at callProviderLifecycles (/node_modules/@angular/core/bundles/core.umd.js:11220:18)
    at callElementProvidersLifecycles (/node_modules/@angular/core/bundles/core.umd.js:11189:13)
    at callLifecycleHooksChildrenFirst (/node_modules/@angular/core/bundles/core.umd.js:11173:17)
    at destroyView (/node_modules/@angular/core/bundles/core.umd.js:12509:5)
    at callViewAction (/node_modules/@angular/core/bundles/core.umd.js:12655:13)
    at execComponentViewsAction (/node_modules/@angular/core/bundles/core.umd.js:12567:13)
    at destroyView (/node_modules/@angular/core/bundles/core.umd.js:12508:5)
    at callViewAction (/node_modules/@angular/core/bundles/core.umd.js:12655:13)
    at execEmbeddedViewsAction (/node_modules/@angular/core/bundles/core.umd.js:12593:17)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions