Skip to content
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

When using generate staticPaths, staticProps and then use it to get page - it always says 404. Only works for fallback: 'blocking' #102

Open
NazariiStrohush opened this issue Jan 31, 2023 · 5 comments

Comments

@NazariiStrohush
Copy link

Describe the bug
Hi, I'm trying to use generating static pages

  1. Created paths

image

2. Get static props get never fired and always throws an error 404 event if path is 100% matching

image

image

Expected behavior
Path is matching and I see pre-rendered page

To Reproduce

Repository URL: Repo is private

Version

  • next.js: 13.0.7
  • nest: 8.4.4
  • nest-next: 10.1.0

Additional context
Add any other context about the problem here.

@NazariiStrohush
Copy link
Author

also using this controller code
image

@kyle-mccarthy
Copy link
Owner

Hey please provide a minimal reproducible sample. Keep in mind that nest is the entry point so all requests will hit a node server before being forwarded to next.

@NazariiStrohush
Copy link
Author

Finally can send you a repo to check this one. It's pretty simple, run:

  • npm i
  • npm run dev
  • Go to http://localhost:7000/apps/app1 static page render - not working
  • Go to http://localhost:7000/about - server side render - working well

REPO: https://github.com/NazariiStrohush/nest-next-sample/

Need to help configure how to work for both types not only SSR...

@yakovlev-alexey
Copy link
Contributor

Hi there! I think the reproduction repo is very complex and requires at least some familiarity with Apollo to understand what's happening. The complexity leads me to thinking that the issue might not be lying the nest-next itself.

I'd try booting Nest (npm run dev in you repo) and Next (next dev) separately and side by side. Apollo (inside Next app) should be configured to fetch data from Nest instance (I assume required endpoints are exposed by the Nest app). If the issue persists - it certainly is not caused by nest-next. In your repo you would also need to move pages out of views dir since that is a nest-next feature.

If the issue persists, a less complex reproduction example is needed without external dependencies.

@NazariiStrohush
Copy link
Author

@yakovlev-alexey Ok, I even can reproduce modifying current repo examples, I will create a new one simplified and share it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants