I mean, that's pretty unusual, so

I mean, that's pretty unusual, so without a reproduction it would be hard to tell why. There is documentation in the next-on-pages repo that has an example of a very basic API route
28 Replies
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
The examples.md is the one with the examples in it. Are you able to share a reproduction?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
Please remove the && next export -o build/ from your build script in your package.json file, so that it is just "build": "next build". It looks like it's preventing the Vercel CLI from generating anything for your API route
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
Looks like it was in the first commit to the repo next export is a way to do a static export, so maybe the initial plan was a static export with no server functionality i guess, but it also tears apart the output from next build since it does it's own build and processing
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
Yeah that's because airtable doesn't look to be compatible with the edge runtime. You could try doing the following to get next.js to silence that specific warning in each route the function is used in, but it might break airtable.
export const config = {
runtime: 'edge',
unstable_allowDynamic: ['/node_modules/airtable/**'],
}
export const config = {
runtime: 'edge',
unstable_allowDynamic: ['/node_modules/airtable/**'],
}
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
You could try tailing your deployment with npx wrangler pages deployment tail to view live logs
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
Interesting
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
Where exactly / what exactly is happening when that error is thrown?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
I'll try and look into it this evening
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
No not yet I'm afraid, I couldn't actually build your app because I don't have airtable or openai
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
I mean, if I can't build it I can't run it to reproduce an error response, so not sure what you mean there
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
yes but the app won't build because i dont have api keys. are you saying it will build if i just use random values?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP14mo ago
Even trying with dummy values for the env vars, I still can't get the app to work properly to be able to reproduce the reflect.get error, since i just get errors about not being authenticated to use the service instead. And if I use fake data for the airtable stuff, then the openai part throws errors for invalid api keys too. So I really don't see how I would be able to reproduce this to try and figure out what the problem is
No description
No description
James
JamesOP14mo ago
And Reflect is very common when working with js proxies, so I'd be surprised if your lead hasn't heard of it before.
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
James
JamesOP13mo ago
When you say working locally, have you tested it using npx wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat, or just next dev?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server