Replies: 19 comments 6 replies
-
My issue has been fixed by removing |
Beta Was this translation helpful? Give feedback.
-
I have the same issue in Azure. Works fine on my local machine, but when deployed to Azure, the files it not found (despite copying it) |
Beta Was this translation helpful? Give feedback.
-
@aramikuto did you find any workaround ? |
Beta Was this translation helpful? Give feedback.
-
@Alexandredc // middleware.ts
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
export const config = {
matcher: "/_next/static/chunks/:path*",
};
export const middleware = (request: NextRequest) => {
const url = new URL(request.url);
const decodedPathname = url.pathname.split("/").map(decodeURIComponent).join("/");
const encodedPathname = decodedPathname.split("/").map(encodeURIComponent).join("/");
const includesEncodableChar = url.pathname !== encodedPathname;
if (!includesEncodableChar) return;
const hasAlreadyDecoded = url.pathname === decodedPathname;
if (hasAlreadyDecoded) return;
const destination = new URL(url);
destination.pathname = encodedPathname;
return NextResponse.rewrite(destination);
}; |
Beta Was this translation helpful? Give feedback.
-
I have tried in Google Cloud Run and it doesn't work :( |
Beta Was this translation helpful? Give feedback.
-
@ForsakenHarmony Do you have some guidance to implement a workaround, please? 🙏 |
Beta Was this translation helpful? Give feedback.
-
@Alexandredc I'm currently waiting on a response from Vercel to confirm if they recognize this as an issue. If you need to upgrade right away, it might be worth exploring options for deploying static assets separately; for example, you could use Firebase Hosting to serve static resources. I haven’t checked yet, but hopefully, Firebase Hosting isn’t impacted by the issue. |
Beta Was this translation helpful? Give feedback.
-
We have the same running in a Docker container in Azure. It is currently blocking us from upgrading. Unfortunately the middleware workaround doesn't work for us. |
Beta Was this translation helpful? Give feedback.
-
@aramikuto do you have any news from Vercel ? |
Beta Was this translation helpful? Give feedback.
-
Finally, I have found a simple solution that work on Google Cloud Run. Add a rewrite rule on import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
output: 'standalone',
rewrites: async () => {
return {
beforeFiles: [
{
source: '/_next/static/chunks/app/:folder/@breadcrumb/:path*',
destination: '/_next/static/chunks/app/:folder/%40breadcrumb/:path*'
}
],
afterFiles: [],
fallback: []
};
}
};
export default nextConfig; |
Beta Was this translation helpful? Give feedback.
-
@Alexandredc unfortunately no news yet. Thank you for sharing the workaround! |
Beta Was this translation helpful? Give feedback.
-
For anyone also experiencing this on Google Cloud Run For me @Alexandredc workaround didn't work because I was using both dynamic routes and route groups. My path looks like this: I fixed it by adding a wildcard to the folder slug: import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin();
/** @type {import("next").NextConfig} */
const config = {
output: "standalone",
rewrites: async () => ({
beforeFiles: [
{
// Added wildcard to ':folder' -> ':folder*'
source: "/_next/static/chunks/app/:folder*/@employer/:path*",
destination: "/_next/static/chunks/app/:folder*/%40employer/:path*",
},
// more parrallel rewrites
],
afterFiles: [],
fallback: [],
}),
};
export default withNextIntl(config); |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, was investigating this— The PR that is causing this issue for Azure and Cloud Run (as far as I'm aware) is because both platforms are (I don't see why they should be, I would consider that a bug/unusual to do) decoding the request path in-flight. The Next.js PR fixed an issue where the pathing was not consistent (described in the PR description).
Let me know if you have any further questions! |
Beta Was this translation helpful? Give feedback.
-
Hi there! Any updates on this issue yet? I’m still experiencing the same problem with Next.js 15.0.3 on Azure. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Is there any further progress on this? We've double encoded for now, but seems like a recipe for breaking further down the line. |
Beta Was this translation helpful? Give feedback.
-
Bumping the discussion since I've moved my entire app to parallel routes just to discover that it doesn't work in GCP 😮💨 |
Beta Was this translation helpful? Give feedback.
-
Another bump, upgraded to Next 15 only to find out parallel routes are broken... 🙈 |
Beta Was this translation helpful? Give feedback.
-
I tried the solutions suggested above, but they didn’t resolve the issue in our case. In our case, the issue was caused by the proxy decoding parts of the URL, this led to broken requests on the Next.js server. Our backend partner resolved it by configuring the proxy to forward the original, unmodified URL. For our setup (Apache), this was done by adding the |
Beta Was this translation helpful? Give feedback.
-
just run into this with google cloud run and was very surprised that such a basic thing like serving static files is such an issue. :-/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to the code that reproduces this issue
https://github.com/aramikuto/nextjs-parallel-route-server-js-problem
To Reproduce
Current vs. Expected behavior
In Next.js 14, the @ symbol in the chunk URL is not encoded, appearing as:
http://localhost:3000/_next/static/chunks/app/@modal/page-5d9f089824f6dc9b.js
In Next.js 15.0.0 and 15.0.1-canary.1, the @ symbol is encoded as %40, so the URL looks like:
http://localhost:3000/_next/static/chunks/app/%40modal/page-e0360b9b769efb1a.js
When deployed to Cloud Run, this chunk becomes inaccessible because Some encoded URL characters are decoded by Cloud Run. It seems Cloud Run decodes %40 back to @, but the standalone server on Next.js 15 responds with a 404 error for such requests.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:16:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8112 Available memory (MB): 24576 Available CPU cores: 8 Binaries: Node: 20.11.1 npm: 10.2.4 Yarn: 1.22.21 pnpm: N/A Relevant Packages: next: 15.0.1-canary.1 // Latest available version is detected (15.0.1-canary.1). eslint-config-next: N/A react: 19.0.0-rc-69d4b800-20241021 react-dom: 19.0.0-rc-69d4b800-20241021 typescript: 5.3.3 Next.js Config: output: standalone
Which area(s) are affected? (Select all that apply)
Parallel & Intercepting Routes
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
It seems this issue may have been introduced in PR #70256.
Beta Was this translation helpful? Give feedback.
All reactions