Search code examples
npmnext.jssupabasesupabase-databasesupabase-js

Module not found: Can't resolve 'encoding' in '/vercel/path0/node_modules/cross-fetch/node_modules/node-fetch/lib'


Has anyone come across this non-breaking warning issue that you get with the npm package: @supabase/supabase-js

The warning message:

warn  - ./node_modules/cross-fetch/node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in '/Users/maxsilva/Sites/kamapay/sasa-frontend/node_modules/cross-fetch/node_modules/node-fetch/lib'

Import trace for requested module:
./node_modules/cross-fetch/node_modules/node-fetch/lib/index.js
./node_modules/cross-fetch/dist/node-ponyfill.js
./node_modules/@supabase/supabase-js/dist/main/lib/fetch.js
./node_modules/@supabase/supabase-js/dist/main/SupabaseClient.js
./node_modules/@supabase/supabase-js/dist/main/index.js
./lib/supabaseClient.js
./app/[lng]/page.jsx

Solution

  • As stated in the comment, you'll need to run this:

    Vanilla NPM:

    npm add -D encoding
    

    PNPM:

    pnpm add -D encoding