Next.js Discord

Discord Forum

ERR_INVALID_ARG_TYPE during build process

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
hi i am getting the following error when runnig npm run build on my nextjs project:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined

i have isolated the line of code that is faulty and i just dont know what is even wrong:

const { access_token, refresh_token } = await response.json();
const encrypted_access_token = encrypt(access_token);

access_token should be of type any. in developement there is no issue. i dont even understand how when building the app the access token can be undefined. i have tried try catch blocks and if (!access_token) but nothing works. does anybody have any idea why?

0 Replies