#ImageResponse - Module not found: Can't resolve 'fs'

3 messages · Page 1 of 1 (latest)

lament lark
#

I just upgraded to 13.3 and replaced import { ImageResponse } from '@vercel/og'; with import { ImageResponse } from 'next/server'; Starting the dev server now throws this error:

./node_modules/.pnpm/[email protected]_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/compiled/@vercel/og/index.node.js:17950:0
Module not found: Can't resolve 'fs'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/.pnpm/[email protected]_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/web/spec-extension/image-response.js
hollow vapor
#

Can you please share where are you using this import. File system library can be accessible from server side code not from client side. For example you can access file system library from getserversideprops or route apis

sleek skiff
#

I'm getting this error too now after upgrading to 13.3 from 13.2

info  - Using wasm build of next-swc
warn  - Attempted to load @next/swc-darwin-arm64, but it was not installed
wait  - compiling /page (client and server)...
error - ./node_modules/next/dist/compiled/@vercel/og/index.node.js:17950:0
Module not found: Can't resolve 'fs'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/next/dist/server/web/spec-extension/image-response.js
./node_modules/next/server.js
./node_modules/@supabase/auth-helpers-nextjs/dist/index.js
./src/app/SupabaseProvider.tsx