Closed kleenkanteen closed 12 months ago
I think I found the fix. In the base tsconfig.json
, replace line 27 with this "exclude": ["node_modules", "supabase/functions"]
. This will ignore that folder during build.
Source of where I got help from: https://github.com/vercel/next.js/discussions/11113#discussioncomment-37588. Read, "What is included in the build seems to depend a lot on tsconfig.json when you use TypeScript. So excluding failing files seems to work for me."
But supabase/functions/_lib/database.ts
is imported into app\chat\page.tsx
on line 7. You will have to copy the former into the lib
folder and then import it from there.
You might ask why not run npm run dev
? Because when I run it and try to sign up, it gives me the error "Error: Hydration failed because the initial UI does not match what was rendered on the server." That was with the starter idk why it happened.
The tsconfig.json
workaround is not ideal since typescript errors don't show up. Just made a silly error that only got caught after deploying the edge function and running it.
Thanks for reporting @kleenkanteen! I created a PR to address the build specific issues: #9
Let's address the npm run dev
issue in #8
Fixed via #9. Feel free to reopen/comment if you experience any more build related issues!
Bug report
Describe the bug
I am developing using the cloud, no docker.
When I run
npm run build
, I get this error:Text version:
In
next.config.js
I tried adding to the nextConfig objectexclude: ['supabase'],
but it does not work.I tried adding this too but no banana:
Here is above both tries in the next.config file:
As a workaround I deleted every folder inside
supabase/functions
exceptlib
. And I deleted themarkdown-parser.ts
file there since that's where the issue was. Thennpm run build
worked.Also why is mdast used? The npm page for it says it's deprecated and it's actually renamed remark, https://www.npmjs.com/package/mdast