File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,18 @@ export default function vitePluginRsc(
265265 ...result . ssr . noExternal . sort ( ) ,
266266 ]
267267
268+ // vendor and optimize use-sync-external-store since
269+ // this is a common transitive cjs dep, which tends to cause a cryptic error.
270+ const vendorDeps = [
271+ `${ PKG_NAME } /vendor/use-sync-external-store` ,
272+ `${ PKG_NAME } /vendor/use-sync-external-store/with-selector` ,
273+ `${ PKG_NAME } /vendor/use-sync-external-store/with-selector.js` ,
274+ `${ PKG_NAME } /vendor/use-sync-external-store/shim` ,
275+ `${ PKG_NAME } /vendor/use-sync-external-store/shim/index.js` ,
276+ `${ PKG_NAME } /vendor/use-sync-external-store/shim/with-selector` ,
277+ `${ PKG_NAME } /vendor/use-sync-external-store/shim/with-selector.js` ,
278+ ]
279+
268280 return {
269281 appType : 'custom' ,
270282 define : {
@@ -311,6 +323,7 @@ export default function vitePluginRsc(
311323 'react/jsx-dev-runtime' ,
312324 'react-dom/server.edge' ,
313325 `${ REACT_SERVER_DOM_NAME } /client.edge` ,
326+ ...vendorDeps ,
314327 ] ,
315328 exclude : [ PKG_NAME ] ,
316329 } ,
You can’t perform that action at this time.
0 commit comments