#Can't Resolve "encoding" module error thing while using Nextjs 13 + Supabase

4 messages · Page 1 of 1 (latest)

rough flame
#

Hi to all, I'm trying to use Supabase for inserting/collecting data from my form. Here is the 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)
}
#

This is the error.

digital girder
#

@rough flame you're trying to use the supabase client in the browser - this isn't supported. It is backend only.