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.

Redirect plugin issue with custom next js server

default discord avatar
redhorse7422last year
8

Hi. i am using next custom server and i have just add redirect plugin and in next.js i am just want to fetch the collection record of redirects and in production mode its working fine but foe build mode its not working, giving error that no collection found. please someone can help me on this



Redirect plugin issue with custom next js server

  • default discord avatar
    notchrlast year

    @redhorse7422 Good morning - can we check out your redirects collection config?

  • default discord avatar
    redhorse7422last year

    its directly created by redirect plugin

    image.png
  • default discord avatar
    notchrlast year

    Hmm, @jacobsfletch was the last person to touch this plugin, perhaps they can provide some info!

  • default discord avatar
    redhorse7422last year

    @jacobsfletch Could you please look into this

  • discord user avatar
    jacobsfletch
    last year

    @redhorse7422 can you show how you’re calling the plugin in your Payload config?

  • default discord avatar
    redhorse7422last year
    image.png
  • discord user avatar
    jacobsfletch
    last year

    @redhorse7422 you need to remove

    redirects

    from the

    collections

    array in your plugin config, that will likely fix your issue 👍



    the plugin instantiates that collection for you, and so you are referencing a collection that does not yet exist

  • default discord avatar
    redhorse7422last year

    @jacobsfletch issue is that actually its working fine in production mode but in build mode its not working giving error



    image.png
    image.png
    image.png
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.