-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during SSR #9242
Comments
@feus4177 Can you supply a reproduction sample or a scaffolding command for us to diagnose further? We're currently blocked by a Stencil issue, ionic-team/stencil#4010, so we may be unable to mitigate depending on the instance. |
@feus4177 Following up if you can supply us with a repro sample to diagnose further. |
@geospatialem, sorry it took so long to get back to you. Here is a repo with a minimal reproduction. From the root directory of the repo, run I now get a slightly different error: The only unusual aspect of my code is the update to the vite.config.js file where I added the
as mentioned above. Without that config, I get an error about importing CommonJS modules from an ES module. |
@benelan @geospatialem I came upon this same issue when trying to use the Custom Elements build in Gatsby, and I created another test repo that might be useful: https://github.com/noahmulfinger/gatsby-calcite-components It seems that the SSR fails due to two files using browser-only objects:
If I remove the references in the two files (and replace them with dummy strings/classes), there are no longer any SSR errors. |
**Related Issue:** #9242 ## Summary Add additional browser checks to resolve some SSR errors that Stencil's `Build.isBrowser` util doesn't catch.
Installed and assigned for verification. |
**Related Issue:** #9242 ## Summary Add additional browser checks to resolve some SSR errors that Stencil's `Build.isBrowser` util doesn't catch.
Verified locally. |
Check existing issues
Actual Behavior
Throws an error during import.
Expected Behavior
No errors are thrown during import.
Reproduction Sample
SSR problem
Reproduction Steps
Setup a default vite 5.1 build with the following added to the vite config
Reproduction Version
2.8.0
Relevant Info
MacOS
Regression?
No response
Priority impact
p4 - not time sensitive
Impact
Unable to use calcite-components. Will probably have to use a different library.
Calcite package
Esri team
N/A
The text was updated successfully, but these errors were encountered: