File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -147,10 +147,6 @@ export const withPayload = (nextConfig = {}) => {
147
147
toReturn . env . NEXT_BASE_PATH = nextConfig . basePath
148
148
}
149
149
150
- if ( nextConfig . assetPrefix ) {
151
- toReturn . env . NEXT_ASSET_PREFIX = nextConfig . assetPrefix
152
- }
153
-
154
150
return toReturn
155
151
}
156
152
Original file line number Diff line number Diff line change @@ -922,11 +922,13 @@ export const getPayload = async (
922
922
) {
923
923
try {
924
924
const port = process . env . PORT || '3000'
925
- const basePath = process . env . NEXT_BASE_PATH || ''
926
- const assetPrefix = process . env . NEXT_ASSET_PREFIX || ''
925
+
926
+ const path = '/_next/webpack-hmr'
927
+ // The __NEXT_ASSET_PREFIX env variable is set for both assetPrefix and basePath (tested in Next.js 15.1.6)
928
+ const prefix = process . env . __NEXT_ASSET_PREFIX ?? ''
927
929
928
930
cached . ws = new WebSocket (
929
- `ws://localhost:${ port } ${ basePath } ${ assetPrefix } /_next/webpack-hmr ` ,
931
+ process . env . PAYLOAD_HMR_URL_OVERRIDE ?? `ws://localhost:${ port } ${ prefix } ${ path } ` ,
930
932
)
931
933
932
934
cached . ws . onmessage = ( event ) => {
You can’t perform that action at this time.
0 commit comments