我正在尝试使用 Supabase 从我的表单插入/收集数据。但是当我编译时,出现编码模块未找到错误。我已经尝试过缓存清理和重新安装 npm 模块。他们也没有工作。
项目结构:
apply/page.tsx 代码:
"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)
}
Run Code Online (Sandbox Code Playgroud)