algolia / react-instantsearch

⚡️ Lightning-fast search for React and React Native applications, by Algolia.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/
MIT License
1.97k stars 386 forks source link

docs(example-ssr): use cjs imports #3657

Closed Haroenv closed 1 year ago

Haroenv commented 1 year ago

Summary

The example is ran using node without esm, and webpack also isn't set up for proper esm, so this errors in modern node (14+) if we use esm.

Setting up for proper esm (type module etc) wouldn't be representative for most users, so we'll fall back to cjs

CR-2214

Result

using cjs imports in hooks-ssr example

codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9d2fa92b25eb1deede141d47742720abc1db72fb:

Sandbox Source
react-instantsearch-app Configuration
hooks-example Configuration
netlify[bot] commented 1 year ago

Deploy Preview for react-instantsearch ready!

Name Link
Latest commit 9d2fa92b25eb1deede141d47742720abc1db72fb
Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/634ffc502ba5e2000771855b
Deploy Preview https://deploy-preview-3657--react-instantsearch.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.