Skip to content

Robots.txt Not Found #53606

Description

@aarajbhattarai

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64
    Binaries:
      Node: 16.14.0
      npm: 8.5.0
      Yarn: 1.22.17
      pnpm: 7.14.0
    Relevant Packages:
      next: 13.4.12
      eslint-config-next: 13.4.12
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.5

Which area(s) of Next.js are affected? (leave empty if unsure)

App Router, Metadata (metadata, generateMetadata, next/head)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/aarajbhattarai/speedwings

To Reproduce

Location of robots.txt file: app/

From this app directory, other metadata such as favicon are being fetched. The robots.txt is also built in the runtime.

Build Log:

Screenshot 2023-08-05 at 5 36 08 PM

Directory Screenshot

Screenshot 2023-08-05 at 5 38 29 PM

Describe the Bug

When opened in URL "localhost:3000/en/robots.txt"
I have tried adding the robots.txt inside the [lang] but it didn't work. I have also tried generating the robots.txt by using robots.ts.
It throws the error

Screenshot 2023-08-05 at 5 44 49 PM

Expected Behavior

To open a valid robots.txt file.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions