Repository navigation
fix: passes serverURL through to all formatAdminURL calls - #14869
Conversation
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
|
🚀 This is included in version v3.68.3 |
|
After this bug fix, we have not been able to access our admin. When I access to https://my-domain.com/admin I am redirected to And receive the following error on the server side:
We had to revert to 3.68.2 which works fine. Our serverURL is set to domain https://my-domain.com |
|
For those who are getting the error like @janpolacek mentioned, the issue stems from url formatting.
Clearly a bug in this recent update, even the documentation example uses non trailing slash value.
|
|
Confirmed that downgrad
Confirmed. Downgrading to 3.68.2 let us back in our sites. |
|
Please check effects about serverURL before merge plz |
Fixes #14900. Supersedes #14901. Since #14869, loading the admin panel with a `serverURL` crashes with the following error: ``` ⨯ [TypeError: Invalid URL] { code: 'ERR_INVALID_URL', input: 'http://localhost:3000http://localhost:3000/admin', digest: '185251315' } [12:26:08] ERROR: Failed to create URL object from URL: http://localhost:3000http://localhost:3000/admin, falling back to http://localhost:3000http://localhost:3000/admin ``` This is because the suffix used to create a local req object was changed to include the server URL. As the name implies, it should be a relative path that appends onto the base URL.
Follow up to #14907. Fixes #14900. Since #14869, setting a `serverURL` causes some additional admin routing to break, including `/admin/logout`. We need to ensure that all routes are relative before matching them. --------- Co-authored-by: Jarrod Flesch <[email protected]>
Fixes issues with basePath and NextJS. Many of the links created in the admin panel were not passing a `serverURL` through to the `formatAdminURL` helper. This PR adds all the missing `serverURL` instances and adds a new helper `formatApiURL` that allows for similar route creation but for api routes.
Fixes #14900. Supersedes #14901. Since #14869, loading the admin panel with a `serverURL` crashes with the following error: ``` ⨯ [TypeError: Invalid URL] { code: 'ERR_INVALID_URL', input: 'http://localhost:3000http://localhost:3000/admin', digest: '185251315' } [12:26:08] ERROR: Failed to create URL object from URL: http://localhost:3000http://localhost:3000/admin, falling back to http://localhost:3000http://localhost:3000/admin ``` This is because the suffix used to create a local req object was changed to include the server URL. As the name implies, it should be a relative path that appends onto the base URL.
Follow up to #14907. Fixes #14900. Since #14869, setting a `serverURL` causes some additional admin routing to break, including `/admin/logout`. We need to ensure that all routes are relative before matching them. --------- Co-authored-by: Jarrod Flesch <[email protected]>
Fixes payloadcms#14900. Supersedes payloadcms#14901. Since payloadcms#14869, loading the admin panel with a `serverURL` crashes with the following error: ``` ⨯ [TypeError: Invalid URL] { code: 'ERR_INVALID_URL', input: 'http://localhost:3000http://localhost:3000/admin', digest: '185251315' } [12:26:08] ERROR: Failed to create URL object from URL: http://localhost:3000http://localhost:3000/admin, falling back to http://localhost:3000http://localhost:3000/admin ``` This is because the suffix used to create a local req object was changed to include the server URL. As the name implies, it should be a relative path that appends onto the base URL.
Follow up to payloadcms#14907. Fixes payloadcms#14900. Since payloadcms#14869, setting a `serverURL` causes some additional admin routing to break, including `/admin/logout`. We need to ensure that all routes are relative before matching them. --------- Co-authored-by: Jarrod Flesch <[email protected]>

Fixes issues with basePath and NextJS. Many of the links created in the admin panel were not passing a
serverURLthrough to theformatAdminURLhelper.This PR adds all the missing
serverURLinstances and adds a new helperformatApiURLthat allows for similar route creation but for api routes.