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
In such cases you get ReferenceError: MutationObserver is not defined exception.
This SDK should check whether the API is available and use Polyfills (if available for our use case) or use different API alltogether specific to Node.js. When using API specific do Node.js, be sure to "exclude" this code publicly exported API that might be used in browser where this API is not available as it might prevent you from building the library with Typescript/Webpack etc.. Careful testing is needed for this to work both in node.js & browsers.
If none of this is possible, we should add a disclaimer that node.js is not supported, but I don't think that should be our goal as this should be quite common use case.
The text was updated successfully, but these errors were encountered:
Brief bug description
Using this SDK is problematic under node.js (e.g. when using Angular universal = SSR) because SDK directly invokes browser specific API -
MutationObserver
(https://github.com/Kentico/kontent-smart-link/blob/e173a36628ccfb851a0f54b93a965957b3d3e309/src/lib/NodeSmartLinkProvider.ts#L44)In such cases you get
ReferenceError: MutationObserver is not defined
exception.This SDK should check whether the API is available and use Polyfills (if available for our use case) or use different API alltogether specific to Node.js. When using API specific do Node.js, be sure to "exclude" this code publicly exported API that might be used in browser where this API is not available as it might prevent you from building the library with Typescript/Webpack etc.. Careful testing is needed for this to work both in node.js & browsers.
If none of this is possible, we should add a disclaimer that node.js is not supported, but I don't think that should be our goal as this should be quite common use case.
The text was updated successfully, but these errors were encountered: