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
The Antvis G2 library fails when building it in Rollup, or if the package is simply imported in a setup like next.js, Gatsby, Meteor that does both server-side and client-side rendering.
As a user I would not expect G2 to try to render anything if no DOM is available.
As a user I would not expect G2 to fail if it's imported in a server-side environment, (simply do nothing or log a warning, but there should be no errors).
Please please add a simple safeguard check at the entry point of G2 that prevents the library from failing if it's read in a server-side environment.
Something like this:
if (!process.browser) {
return undefined
}
This ticket is related to #296, but not asking for a workaround, requesting this to be fixed permanently for everyone allowing BizCharts to be bundled and at least not break when imported serverside.
This ticket is NOT about adding server-side rendering support! Please don't confuse this with a request to make G2 work serverside.
It just shouldn't break the build if document isn't available.
The text was updated successfully, but these errors were encountered:
The Antvis G2 library fails when building it in Rollup, or if the package is simply imported in a setup like next.js, Gatsby, Meteor that does both server-side and client-side rendering.
As a user I would not expect G2 to try to render anything if no DOM is available.
As a user I would not expect G2 to fail if it's imported in a server-side environment, (simply do nothing or log a warning, but there should be no errors).
Please please add a simple safeguard check at the entry point of G2 that prevents the library from failing if it's read in a server-side environment.
Something like this:
This ticket is related to #296, but not asking for a workaround, requesting this to be fixed permanently for everyone allowing BizCharts to be bundled and at least not break when imported serverside.
This ticket is NOT about adding server-side rendering support! Please don't confuse this with a request to make G2 work serverside.
It just shouldn't break the build if document isn't available.
The text was updated successfully, but these errors were encountered: