21

I'm trying to use Supabase for inserting/collecting data from my form. But when I compile I got encoding module is not found error. I already tried cache cleaning and re-installing npm modules. They didn't work either.

Project Structure:

enter image description here

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 I Got: enter image description here

Poyraz HANCILAR
  • 409
  • 1
  • 4
  • 12

3 Answers3

25

This is just a warning that can be safely ignored. We're working on removing it. You can follow along here: https://github.com/supabase/supabase-js/issues/612

thorwebdev
  • 818
  • 4
  • 9
6

To fix this, I ran npm install encoding and the error was gone!

Igor Stepanov
  • 69
  • 1
  • 2
3

I used a simple solution which was to use

npm i -D encoding

But the supabase community should have already solved this problem. However, they changed the authentication mode with the new versions of next 13. Which is a serious problem because I didn't want to have to redo the authentication of my project.

Kazuki
  • 51
  • 3