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•14mo ago
Message Not Public
Sign In & Join Server To View
The examples.md is the one with the examples in it. Are you able to share a reproduction?
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
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 routeUnknown User•14mo ago
Message Not Public
Sign In & Join Server To View
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•14mo ago
Message Not Public
Sign In & Join Server To View
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.
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
You could try tailing your deployment with
npx wrangler pages deployment tail
to view live logsUnknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Interesting
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Where exactly / what exactly is happening when that error is thrown?
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
I'll try and look into it this evening
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
No not yet I'm afraid, I couldn't actually build your app because I don't have airtable or openai
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
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•14mo ago
Message Not Public
Sign In & Join Server To View
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•14mo ago
Message Not Public
Sign In & Join Server To View
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
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•13mo ago
Message Not Public
Sign In & Join Server To View
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•13mo ago
Message Not Public
Sign In & Join Server To View