Closed greynewell closed 9 months ago
You can see an example of this issue occurring here: https://github.com/greynewell/greynewell.com
Worth noting that (of course) generateStaticParams()
is in fact defined.
Another user seems to have the same issue with next.js
:
https://github.com/vercel/next.js/issues/54393#issuecomment-1773808636
Strange, I just tested it a month ago and it worked. Not sure if there was a bug introduced in the new version of next.
@timlrx will give it another go with a fresh clone in the morning.
According to the comments on the Next issue I linked, error message was not displayed before, but the static files were not being generated. (I have not rolled back to test this assertion myself).
@greynewell any further issues? Recently, I wrote up a guide on deploying it to Github pages and verified that the static build process works.
Managed to get it running (here) by following the guide, thanks @timlrx!
One thing though- the RSS feed is giving a 404 for some reason :( I do see the feed.xml
file generated when I run yarn build
locally and can access the file when I do a local serve, so not sure why the GH pages site is giving trouble.
Anyone else still facing this issue? I've had to remove the tags
route for now.
For people seeing this in the future: I was running into this, and it was because I didn't have any posts with tags. I just added a tag to one of my posts, and the builds started passing.
@patrickstorm would it add value to have a descriptive error message here?
@patrickstorm would it add value to have a descriptive error message here?
@greynewell I suppose, but probably not worth the effort since it seems so few people run into this issue. And now if they find this github issue, they have a solution. I think the real fix would be to allow builds without any tags present.
Describe the bug I am unable to generate static pages following the instructions in the
README
.To Reproduce Steps to reproduce the behavior (taken from the README):
Add
output: 'export'
innext.config.js
. See static exports documentation for more information.Comment out
headers()
fromnext.config.js
.Change
components/Image.tsx
to use a standard<img>
tag instead ofnext/image
:Alternatively, to continue using
next/image
, you can use an alternative image optimization provider such as Imgix, Cloudinary or Akamai. See image optimization documentation for more details.Remove
api
folder and components which call the server-side function such as the Newsletter component. Not technically required and the site will build successfully, but the APIs cannot be used as they are server-side functions.Run
yarn build
. You will receive the following error:Expected behavior I expect
yarn build
to generate a static version of the blog.System Info (if dev / build issue):
macOS
v18.2
8.9.0
Additional context Add any other context about the problem here.