Error using calcite components in Gatsby site during server-side rendering #7493
Closed
3 tasks done
Labels
4 - verified
Issues that have been released and confirmed resolved.
ArcGIS Developer Experience
Issues logged by ArcGIS Developer Experience team members.
bug
Bug reports for broken functionality. Issues should include a reproduction of the bug.
calcite-components
Issues specific to the @esri/calcite-components package.
calcite-components-react
Issues specific to the @esri/calcite-components-react package.
estimate - 1
Very small fix or change (potentially a single line), doesn't require updates to tests.
impact - p1 - need for current milestone
User set priority impact status of p1 - need for current milestone
p - high
Issue should be addressed in the current milestone, impacts component or core functionality
Milestone
Check existing issues
Actual Behavior
When using calcite components 1.5.X on a page in a Gatsby site, the page throws an error during server-side rendering
error "navigator" is not available during Server-Side Rendering
. The stack trace takes me to the interactive.ts file where it is usingnavigator
to check the user agent string:calcite-design-system/packages/calcite-components/src/utils/interactive.ts
Lines 30 to 36 in bb07831
Expected Behavior
I would expect a server-side rendered page in a Gatsby site (or other static site generator) to be able to render the components without throwing a build error.
Reproduction Sample
See devtopia documentation repo
Reproduction Steps
kit12303/update-150
npm run build:afd
Reproduction Version
1.5.1
Relevant Info
No response
Regression?
1.4.3
Priority impact
p1 - need for current milestone
Impact
Blocks the developer documentation from being deployed for the 1.5 release.
Calcite package
Esri team
ArcGIS Developer Experience
The text was updated successfully, but these errors were encountered: