Hey @amiram,
We’ve added the environment variable for your site from our end. Let us know if it works.
If others need that variable as well, please let us know the site id or subdomain and we can get it added.
Hey @amiram,
We’ve added the environment variable for your site from our end. Let us know if it works.
If others need that variable as well, please let us know the site id or subdomain and we can get it added.
Hi. Do you mind adding the variable for this site id: 842a3cc6-6d53-4d8f-85da-854ea2f433f2
I’m getting an error because “variable must start with a letter”
Hi @hrishikesh,
Do you mind adding the env var to my site as well. The siteID is f50f99c1-9959-499f-bccf-84ad47a8c51b.
I even added a Netlify Support email but looks like it will take a while. Hoping to get it done faster throug here.
Thank you.
Hi @hrishikesh Would you be able to add the variable for me as well?
The siteID is 4a52ab6f-2827-4fec-86ff-6c66b52059e6
Thank you very much
Hi @hrishikesh ,
Please add the env variable to our site also:
Site ID: f6920b29-cfac-4cbb-ac1f-3c34cabef01e
Thank you.
You can use the Netlify CLI to add this environment variable, e.g.
➜ netlify env:set __NEXT_PRIVATE_PREBUNDLED_REACT next
Set environment variable __NEXT_PRIVATE_PREBUNDLED_REACT= next in the all context
nickyt.online on main [✘!?] via v18.15.0 took 3s
➜ netlify env:list
1 environment variable for site somesite in the dev context
.-------------------------------------------------.
| Environment variables |
|-------------------------------------------------|
| Key | Value | Scope |
|---------------------------------|-------|-------|
| __NEXT_PRIVATE_PREBUNDLED_REACT | next | All |
'-------------------------------------------------'
? Show values? Yes
To clarify, this should work for anyone at any account level. You may need to configure the CLI first, so this is the doc for that:
https://cli.netlify.com/getting-started
(you’ll need to have done at least netlify login
and also netlify link
before you can use the CLI workflow explained above.)
@sadhikari and @roberto I managed to get the variable added for your sites before Nick taught us this trick.
When you are ready for it to be removed, that will be possible through the UI
Receiving this error when using that env variable, with the deploy failing:
Invalid AWS Lambda parameters used in this request.
Confirmed it’s being set correctly and upgraded to Next.js 13.4.2 (latest). Anyone else been able to successfully deploy? Just tested over at Vercel and it works out-of-the-box (not surprisingly).
I have the same exact error. I am not adding any env variables that might clash with AWS.
There’s a pull request tracking the upgrade of Next runtime to 13.4.x here: chore: upgrade to next v13.4 by taty2010 · Pull Request #2080 · netlify/next-runtime · GitHub
From what I’ve found, this happens on any error, including automatic handling of 404s, fetch requests that don’t return 200 and manually triggering notFound() in the page component. I’ve testet this up to 13.4.2 and it always leads to 500. It’s especially annoying because it’s impossible to debug what the underlying error is right now. You can try/catch yourself and avoid the problem, but it’s really not a solution.
3:13:45 PM: Failed during stage 'building site':
Environment variable key '__NEXT_PRIVATE_PREBUNDLED_REACT'
must start with a letter
Was able to add the variable however the deploy fails at the initialization phase.
Hey all! We’re aware of the issues around this change with Next.js and are working to ensure Next.js continues working normally on Netlify. As soon as we have any further updates, we’ll update this thread.
Would it be possible to have some more transparency on which version of next the netlify runtime currently supports “stable”? I feel like it’s really hard to get an answer on that and should at least be public in the runtime readme on github.
Hi @hrishikesh
Can you add the env variable for this site aswell:
siteID: da2f62d5-0e6b-4205-9096-3f32d0ff5bd6
Thank you!
Hi, I have found quite a janky solutions but works for me.
Turns out the __NEXT_PRIVATE_PREBUNDLED_REACT
environment variable might have nothing to do with build process regarding to NextJS code, it uses to override to uses Vercel’s precompiled react-dom that has ./server.edge
imports on next/server
runtime. Means that this variable has to be present in Lambda functions. But because of some quirks you cannot add them directly.
So, I do some patches to make react overriding to always trigger before starts any builds and my site now works normally without issues.
Hi @frederikfink this isn’t necessary and won’t help. Also this does not need to be done on our end.
Can confirm that applying the monkey patch above does work for me (next 13.4.3)
Where do you put this code?
In theory, anywhere before next-runtime
bundling functions. But safely, I prefer to patch this code before running next build
or any next
cli.
This is how I did it:
console.log("********* PREBUILDING");
const path = require("node:path");
const fs = require("fs");
const baseDir = process.cwd();
const prebuildScripts = async () => {
const file = path.join(
baseDir,
"/node_modules",
"next/dist/server/require-hook.js"
);
const content = await fs.promises.readFile(file, "utf-8");
await fs.promises.writeFile(
file,
content.replace(
"if (process.env.__NEXT_PRIVATE_PREBUNDLED_REACT) {",
"if (true) {"
)
);
};
prebuildScripts();
"scripts": {
"dev": "next dev",
"prebuild": "node prebuild.js",
"build": "next build",
"start": "next start",
"lint": "next lint"
},