markprompt-js
markprompt-js copied to clipboard
Fix server-side rendering
Describe the bug
Currently, @markprompt/web
does not build on the server side.
To Reproduce Steps to reproduce the behavior:
- Create a swizzled Docusaurus project
- Add a top-level import of
@markprompt/web
inpages/theme/SearchBar/index.tsx
- Run
npm run build
- See Docusaurus server build error, complaining that
document
does not exist.
Expected behavior Server-side building should not break. We should avoid all references to client-only APIs outside of client-side hooks.