9af75d4b2d
We had added encoding the client component assets loaded from RSC manifest that we need to encode them to make sure when they're loaded on server and sent to client, the client will receive the encoded one. But the override of the webpack chunk loading method could be loaded later than react related chunks, that when client component is loaded first (e.g. `next/script`) and it triggers react loaded ealier than the overriding. Then the chunk could be encoded incorrectly. Discussed with @gnoff and put this out as the 1st step solution to ensure the order. in the future we can try to get rid of the encoding by providing safer url Fixes #57829
23 lines
539 B
JavaScript
23 lines
539 B
JavaScript
'use client'
|
|
|
|
import Script from 'next/script'
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
export default function Page() {
|
|
const router = useRouter()
|
|
return (
|
|
<div>
|
|
<button
|
|
id="dynamic-link"
|
|
onClick={() => router.push('/router/dynamic-gsp/1/')}
|
|
>
|
|
Test routing
|
|
</button>
|
|
{/* adding a script here to make sure app internals might execute earlier */}
|
|
<Script
|
|
src="https://connect.facebook.net/en_US/sdk.js"
|
|
strategy="beforeInteractive"
|
|
/>
|
|
</div>
|
|
)
|
|
}
|