-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
Comments
Looking through the open-next codebase, I can see that these html files are removed purposely as they are static, and are to be served by the cache. They are indeed cached, as from the 3rd screenshot in the original post. Is this an issue with SST then, that the cache is not being properly served? |
Are you using |
Nope, not using either |
I have a feeling this is a windows path issue (nextjs bug.) Can you try building in WSL? |
It's definitely an issue with windows. |
Sorry for the delay - needed to install and configure WSL with node, AWS credentials, etc. Building and deploying in WSL resulted in routes that now work as expected: /qa/opportunities does not return a 500 Internal server error but loads properly. Thanks for the help! Where does this leave us with the Windows path handling issue? Is it something that could be looked at? Building in WSL is not a problem (albeit a lot slower), but given that my environment is Windows, it would be more convenient to have that option. |
At the moment i don't think we should put too much effort into windows support for a couple of reasons:
Personally i won't work on windows support (i don't have a good windows machine), but maybe in the future someone will be willing to work on this |
I'll close all the windows related issue in favor of #385 |
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: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):Note that the open-next cache does appear to have the right files too:
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
The text was updated successfully, but these errors were encountered: