Skip to content

Failed to load static file for page: /qa/opportunities ENOENT: no such file or directory, open '/var/task/.next/server/pages/qa/opportunities.html' #366

Closed as not planned
@mfrangakis

Description

@mfrangakis

Attempting to directly access some paths returns a 500 Internal Server Error, with the error Failed to load static file for page: /qa/opportunities ENOENT: no such file or directory, open '/var/task/.next/server/pages/qa/opportunities.html'

The example above would normally be accessible at /qa/opportunities, and it is accessible without issue in my development environment (localhost:3000/qa/opportunities).

Notably, this issue only occurs on the deployed stage if one types the URL into the browser (or refreshes the page). If you navigate from a <Link /> component provided by Next.js, then the issue does not occur and the page can be accessed.

Looking at the output of the open-next command, the open-next\server\.next folder is missing the html files for most of the routes:
image

The above folders are empty as you can see; when in reality, there are quite a few routes in them. To illustrate, compared this to the output of just running the standard Next build command; the .next folder has all the html files I expected (including opportunities):
image

Note that the open-next cache does appear to have the right files too:
image

Other routes are redacted above for confidentiality reasons.

Environment
Next.js 14.1.0
OpenNext 2.3.6
Deployed via SST to the AWS af-south-1 region

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions