leonardogrig / nextjs-openai-article-generator

5 stars 1 forks source link

Error on the join when reading the previous chunks #1

Open ibrahim-sowunmi opened 1 year ago

ibrahim-sowunmi commented 1 year ago

Copied the code as is. Fresh install. No changes.

https://www.youtube.com/watch?v=hUKcq-xxNUc

Ran this video and got the error nrlow

error - src/pages/api/article.tsx (141:55) @ join error - TypeError: Cannot read properties of undefined (reading 'join') at handler (webpack-internal:///(api)/./src/pages/api/article.tsx:123:66) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.apiResolver (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/api-utils/node.js:372:9) at async DevServer.runApi (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/next-server.js:514:9) at async Object.fn (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/next-server.js:828:35) at async Router.execute (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/router.js:243:32) at async DevServer.runImpl (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/base-server.js:432:29) at async DevServer.run (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/dev/next-dev-server.js:831:20) at async DevServer.handleRequestImpl (/Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/base-server.js:375:20) at async /Users/isowunmi/nextjs-openai-article-generator/node_modules/next/dist/server/base-server.js:157:99 { page: '/api/article'

leonardogrig commented 1 year ago

I believe a nullish coalescing operator (??) could resolve that problem. I'll include it in the project as fast as I can! Thanks for the warning.