I encountered an issue while trying to utilize Supabase for handling data insertion/retrieval from my form. Upon compilation, I received an error stating that the encoding module was not found. Despite attempting cache cleaning and re-installation of npm modules, the error persisted.
Project Structure:
https://i.sstatic.net/8FZ0P.png
apply/page.tsx Code:
"use client"
import { supabase } from "lib/supabaseClient"
export default function Apply() {
// This function called by button so we use "use client" at top.
async function createApplyRecord() {
const { error } = await supabase
.from('applications')
.insert({id: 1, fullname: "test", email: "aa", phone: "bb", githuburl: "cc", linkedinurl: "dd", about: "ee"})
console.log("inserted")
if(error) {
console.log(error);
}
}
return (SOME HTML CODE HERE)
}
Error Encountered: https://i.sstatic.net/4iVNK.png