Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

getting .fs import error

default discord avatar
deepak_996389 months ago
1

I was trying to use local APIs in next js - payload v3 app. Suddenly, I got this error


Module not found: Can't resolve 'fs' Did you mean './fs'? Requests that should resolve in the current directory need to start with './'.

my next.config.mjs file looks like this


import { withPayload } from '@payloadcms/next/withPayload' /** @type {import('next').NextConfig} */ const nextConfig = { // Your Next.js config here reactStrictMode:false, } export default withPayload(nextConfig)

where should i add this?



I don't get the option "bundler" in admin in payload.config.ts



could it be because i'm using payload 3.0?



I forgot to add "use server" at the top of my local API file. Adding that fixed the issue.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.