Hey sam, I am having issues with creating a production build of the app. The error is coming from the router file inside the messages directory. However if i remove the edge runtime code line everything works. Do you have any suggestions. Error I get: Build error occurred Error: Failed to collect page data for /api/message ... or if I remove my database queries i make with drizzle it also works fine even if i have the edge run time code.
I figured it out after like 10 days or something 😭. The whole issue was that the version of libsql/client package we had installed ("@libsql/client": "^0.4.0-pre.4",) has issues when it comes to edge run time. For anyone looking to deploy on Vercel or other platforms please make sure you have the most up to date version of the package by running npm i libsql/client
Hey Sam! Love your videos man, I learned a lot with them. That said, how would you test a Next.js application ? Especially like this one, with API routes and openAI service ?
Testing is always a hot topic, and I don't have an answer that most people will agree with, but here goes. My approach and my suggestion to people is to use vitest (maybe bun in the future). Do unit and integration tests, but not end to end tests, and definitely no UI tests. Don't mock if you can avoid it, use a real database if you can, however, definitely mock openai because that service is expensive and brittle. Start with small unit tests of the core functions, then move to integration tests. ONLY WRITE TESTS THAT YOU WILL 100% DEFINITELY MAINTAIN AND TRUST.
Bro, how to process a mathematical formula. I know that there is a plugin in markdown, but it somehow refuses to process the request from gpt. What can be done?
Hey Sam. Could you upload a image, tell it to change the inage or remove a certain thing from it and reiceve back a new image or does this striclty only use GPT 4 vision?
Hey sam, I am having issues with creating a production build of the app. The error is coming from the router file inside the messages directory. However if i remove the edge runtime code line everything works. Do you have any suggestions. Error I get: Build error occurred Error: Failed to collect page data for /api/message ... or if I remove my database queries i make with drizzle it also works fine even if i have the edge run time code.
I figured it out after like 10 days or something 😭. The whole issue was that the version of libsql/client package we had installed ("@libsql/client": "^0.4.0-pre.4",) has issues when it comes to edge run time. For anyone looking to deploy on Vercel or other platforms please make sure you have the most up to date version of the package by running npm i libsql/client
Why is a base64 string not ideal compared to an image URL from s3?
Hey Sam! Love your videos man, I learned a lot with them.
That said, how would you test a Next.js application ? Especially like this one, with API routes and openAI service ?
Testing is always a hot topic, and I don't have an answer that most people will agree with, but here goes.
My approach and my suggestion to people is to use vitest (maybe bun in the future). Do unit and integration tests, but not end to end tests, and definitely no UI tests. Don't mock if you can avoid it, use a real database if you can, however, definitely mock openai because that service is expensive and brittle.
Start with small unit tests of the core functions, then move to integration tests. ONLY WRITE TESTS THAT YOU WILL 100% DEFINITELY MAINTAIN AND TRUST.
Bro, how to process a mathematical formula. I know that there is a plugin in markdown, but it somehow refuses to process the request from gpt. What can be done?
Can you do a full tutorial how we can build this, to a ready prodution app? It will be so cool.
Sorry for the late response here, but the next two videos set you up for this. Check the description for the next one.
Hey Sam. Could you upload a image, tell it to change the inage or remove a certain thing from it and reiceve back a new image or does this striclty only use GPT 4 vision?
Hey SAm, thanks for the videa, is the full version video out yet?
man how are you moving like a well oiled robot?! Amazing video tho
man how are you moving like a well oiled robot?! Amazing video tho
how do use bun with next.js
Very cool stuff 👍
Awesome stuff!!