Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Resolve "encoding" Module Error While Using Nextjs-13 + Supabase

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

like image 917
Poyraz HANCILAR Avatar asked Sep 02 '25 11:09

Poyraz HANCILAR


2 Answers

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

like image 139
thorwebdev Avatar answered Sep 03 '25 23:09

thorwebdev


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

like image 42
Igor Stepanov Avatar answered Sep 04 '25 00:09

Igor Stepanov