You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the other way around, `client-only` import ...todo
541
+
542
+
- server.js
543
+
544
+
```tsx
545
+
exportfunctionServerComponent() {
546
+
todo
547
+
}
548
+
```
549
+
550
+
- client-utils.js
551
+
552
+
```tsx
553
+
import'client-only'
554
+
555
+
todo
556
+
```
557
+
558
+
Note that there are official npm packages [`server-only`](https://www.npmjs.com/package/server-only) and [`client-only`](https://www.npmjs.com/package/client-only) created by React team,
559
+
but they don't need to be installed. `@vitejs/plugin-rsc` internally overrides them to provide a better error message during time instead of runtime error provided by the actual packages.
560
+
561
+
This build time valdiation is enabled by default and it can be disabled by `RscPluginOptions.validateImports:false`.
0 commit comments