We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
System: OS: macOS 14.2.1 CPU: (10) arm64 Apple M1 Max Memory: 94.38 MB / 32.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 120.0.6099.216 Chrome Canary: 122.0.6250.0 Safari: 17.2.1 npmPackages: @rspress/plugin-preview: latest => 1.9.3 rspress: ^1.0.0 => 1.9.3
docs/guide/index.mdx # Error ```tsx console.log(window) <---- break the SSG build function App() { return ( <div> <span>Hello World</span> </div> ); } export default App; \```
I came up with three solutions
rspress-plugin-preview support the components with sideEffect in some way
Add error messages to encourage users to improve the quality of their components to support SSR.
Add error messages to let users who temporarily cannot resolve component SSR support turn off the ssg: false
ssg: false
https://github.com/SoonIter/rspress-preview-demo
pnpm i npm run build
The text was updated successfully, but these errors were encountered:
cc @10Derozan
Sorry, something went wrong.
It has been fixed in #578
<code src="./A.tsx"/> still have this problem.
<code src="./A.tsx"/>
# mdx <code src="./Comp.tsx" />
// Comp.tsx console.log(window) const A = () => <div>12321</div> export default A;
We can use await import to solve it
await import
<code src="./Comp.tsx" /> ⬇️ const Comp = React.lazy(() => import('./Comp.tsx'));
No branches or pull requests
Version
Details
docs/guide/index.mdx # Error ```tsx console.log(window) <---- break the SSG build function App() { return ( <div> <span>Hello World</span> </div> ); } export default App; \```
Solutions
I came up with three solutions
rspress-plugin-preview support the components with sideEffect in some way
Add error messages to encourage users to improve the quality of their components to support SSR.
Add error messages to let users who temporarily cannot resolve component SSR support turn off the
ssg: false
Reproduce link
https://github.com/SoonIter/rspress-preview-demo
Reproduce Steps
The text was updated successfully, but these errors were encountered: