-
Notifications
You must be signed in to change notification settings - Fork 87
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
build fails when using getStaticProps on index.tsx #323
Comments
I'm having the same issue with a different repo but also with the same setup. Do you think it might be the nx + next.js combo? |
@simonpeters hey! i forked your repo but at the very same time got caught up in other issues 😢 yeah, probably, given we've had other issues opened about nx. just double checking - have you seen those issues? specifically #115 and rayriff's last comment? |
Hey @lindsaylevine. This doesn't solve my issue. I have both tried |
@simonpeters gotcha thanks for letting me know. ill get to this asap! |
okay. We are currently using netlify for all our websites so I would prefer using it as well for all next.js projects. but if only been able to deploy NX + next.js to vercel so far. |
@simonpeters i gotchu. hang tight 🙏 ❤️ |
@simonpeters hello! so i finally got around to working through the repo you shared. here is a very unfortunate piece of duct tape i am offering you: lindsaylevine/nx-test@96461de set in the UI (though obv you can put this in your netlify.toml): Build command Publish dir that said, i know this is not a longterm solution we want to offer. i think the way we will support this will go hand-in-hand with #354, when we will then be able to look for the nextConfig, nextDistDir, etc. in the right dir. *i'm also aware that commit merely forces the build to work for this specific repo. the deployed app https://60c2c396c734fd0008d25456--condescending-shaw-4efb4e.netlify.app/ seems to be missing the public assets or looking for them in the wrong place (looking for /star.svg, exists at /public/star.svg) |
I've written up a summary of this and related issues, along with some potential solutions in a new issue: #433 |
hey @simonpeters! thanks for your patience on this. per matt's issue #433, we'll close this in favor of that. please follow along and leave feedback there, but we'll try to circle back here, too, whenever we release support! 🙏 |
Hi. Can you try the branch to see if it fixes it? Instructions in the PR. #434 |
This has been released now. 3.6.0 has specific support for Nx. Can you try installing |
Describe the bug
I'm trying out next.js/nx/netlify combination and my build fails from the moment I add getStaticProps function to index.tsx
The error message is a bit obscure and this doesn't happen on Vercel.
To Reproduce
I have setup an example repo: https://github.com/simonpeters/nx-test
commit
680acdf1
builds but042b554e
doesn'tthe only change is that the code below is added to the
index.tsx
filesuccesful build of
680acdf1
failed build of
042b554e
My build configuration
The text was updated successfully, but these errors were encountered: