[TRI-861] Next.js warning - Module not found: Can't resolve encoding
Using the @trigger.dev/sdk in a Next.js project produces the following warning:
- warn ./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in '/Users/eric/code/triggerdotdev/trigger.dev-examples/latest-packages/node_modules/node-fetch/lib'
It turns out this is a pretty widely experienced warning that doesn't actually effect anything in Next.js. See this supabase-js issue:
https://github.com/supabase/supabase-js/issues/612
encoding is an optional dependency of node-fetch and so there is no issue with it missing.
If you would like to get rid of this warning, just run:
npm add encoding -D
To add the encoding dependency to your dev deps. Of course this won't stop this warning from appearing from production builds, so you can also do:
npm add encoding
Any update on this? Others seems to have fixed this issue such as supabase.
@TotomInc This is going to be fixed once this merged PR is published: https://github.com/triggerdotdev/trigger.dev/pull/581
It removes the usage of node-fetch which is what was causing this error. Will hopefully be released in the next day or so 👍
@ericallam nice! Will this change introduce support for non-node platforms such as Vercel Edge functions, Deno, etc?