## TL;DR

For "Module not found: Can't resolve 'encoding' in '.../node_modules/node-fetch/lib'": my Next.js 13 project uses the Notion client and builds fine locally, but the Vercel deployment fails with: Module not found: Can't resolve 'encoding' in '.../node\_modules/node-fetch/lib'. Did Next.js 13 change something about fetch that breaks this?

```text
Module not found: Can't resolve 'encoding' in '.../node_modules/node-fetch/lib'
```

## Steps

1. My Next.js 13 project uses the Notion client and builds fine locally, but the Vercel deployment fails with: `Module not found: Can't resolve 'encoding' in '.../node_modules/node-fetch/lib'`. I am on Notion SDK 2.2.2 with Node 16/18. Did Next.js 13 change something about fetch that breaks this?

2. This is a warning, not a real failure, and it is not specific to Next.js 13. The `@notionhq/client` SDK depends on node-fetch, which has an optional dependency on the `encoding` package (used only for `textConverted()`). Webpack/Vercel's build flags it because it cannot resolve that optional module. Several users reported it: the build usually still completes and deploys fine, with just the warning printed. If it actually breaks your build or you want it gone, install the optional package yourself with `npm install encoding`. That is the whole fix.

## When to use

You are seeing this: I am on Notion SDK 2.2.2 with Node 16/18. Use this skill when you run into "Notion SDK breaks Next.js 13 Vercel build: `Module not found: Can't resolve 'encoding'`".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: SDK 2.2.2. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/makenotion/notion-sdk-js/issues/365
