[Nextjs, app router, webpack] importing and using payload.find to fetch data crashes things

default discord avatar
sawariz0r
3 months ago
2

Back with my webpack struggles!



So I've based my next site off

https://github.com/payloadcms/nextjs-custom-server

, converted it to use the app router and now I'm running into a few issues when importing and using payload to fetch data.



Just a quick 👋 to see if someone has run into this before 🙂



I'm running the next/payload app on the image

node:18-alpine

.

  • discord user avatar
    dribbens
    Payload Team
    3 months ago

    I'm not an expert on bundlers but it seems like this shouldn't be happening:


    webpack either needs to exclude this kind of file or node_modules entirely and I don't know the answer.



    I bet @jarrod_not_jared would know the answer.

    image.png
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.