Skip to content

Does the fastify-nextjs public folder not work as designed by NextJS? #725

Description

@matthewgisonno

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Maybe I am misinterpreting how this all comes together, but I am using the fastify-nextjs plugin to serve pages from the /src/pages folder... Example: /src/pages/payment-options.js with a route defined like so:

  await app.register(fastifyNextJs).after(async () => {
    await app.next('/payment-options');
  });

That route works fine... That said, I tried creating a public folder at the root of my project as is allowed by NextJS for serving static assets (html, css, js, text, images, etc) and I cannot access the URL via a web browser.

created file:
/public/styles.css

Tried to access via browser at http://localhost/styles.css and I get the standard fastify route doesn't exist 404 error...

{"message":"Route GET:/styles.css not found","error":"Not Found","statusCode":404} in the browser.

Does the fastify-nextjs not allow the nextjs public folder to work like it does in a normal nextjs setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions