We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e64f73 commit 07fb03eCopy full SHA for 07fb03e
node_package/src/RSCClientRoot.ts
@@ -27,7 +27,8 @@ const createFromFetch = async (fetchPromise: Promise<Response>) => {
27
28
const fetchRSC = ({ componentName, rscRenderingUrlPath }: RSCClientRootProps) => {
29
if (!renderCache[componentName]) {
30
- renderCache[componentName] = createFromFetch(fetch(`${rscRenderingUrlPath}/${componentName}`)) as Promise<React.ReactNode>;
+ const strippedUrlPath = rscRenderingUrlPath.replace(/^\/|\/$/g, '');
31
+ renderCache[componentName] = createFromFetch(fetch(`/${strippedUrlPath}/${componentName}`)) as Promise<React.ReactNode>;
32
}
33
return renderCache[componentName];
34
0 commit comments