What am I missing to compile the library for next?
Unanswered
Blue-winged Teal posted this in #help-forum
Blue-winged TealOP
please help me, i am a newbie. I want to create a server library for nextjs that uses fetch from the next configuration, but I don’t understand how to properly configure it and what tools to build it with. Can you please give a similar example or some kind of guide
1 Reply
@Blue-winged Teal please help me, i am a newbie. I want to create a server library for nextjs that uses fetch from the next configuration, but I don’t understand how to properly configure it and what tools to build it with. Can you please give a similar example or some kind of guide
disclaimer: only an untested guess, but with a pretty high confidence
in runtime i think you don't need to configure anything. next.js will automatically inject its global fetch and the options will work normally
for typing then extend
in runtime i think you don't need to configure anything. next.js will automatically inject its global fetch and the options will work normally
for typing then extend
RequestInit, see https://github.com/vercel/next.js/blob/6111845e111f03a027c2fec6cbc15c1ad5547f8c/packages/next/types/global.d.ts#L25-L27