NextJS + [email protected]
Minimal reproduction of this error:
openai/openai-node#182 (comment)
cp .env.example .env.local # then add your API key to .env.local
pnpm install
This seems to be a problem with the v4 beta in the NextJS edge runtime.
pnpm dev
This works
TypeError: Cannot read properties of undefined (reading 'FileObjectsPage')
pnpm build
Results in:
Failed to compile.
./node_modules/.pnpm/[email protected]/node_modules/function-bind/implementation.js
Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation