Open thisismydesign opened 3 years ago
Apparently calling a page index.tsx
will produce this error. Calling it home.tsx
as in your example works. Perhaps a mention of this in the readme?
I got the index
example from here: https://github.com/kelvin-mai/nest-next-example
Hi sorry for the delay in getting back to you. I actually haven't tried to use the nest cli along with this package before, in my example I just use nodemon for the dev
command.
That being said, I don't think that the problem is actually related to naming the page index.tsx
. In the basic example I have a page in /pages/views/blog/index.tsx
and render it in the controller without it 404ing.
I had pages/views/index.tsx
and @Render('index')
, you can reproduce it in the linked repo. Maybe I misunderstood how it's supposed to work, still, it was pretty confusing. Up to you how to handle this, feel free to just close.
I think I'm having a similar issue - I can't seem to get it to work with the Nest CLI
@kyle-mccarthy I can confirm this. i have same issues @Render('index')
throws an error if page is at pages/views/index.tsx
but if it is at pages/views/blog/index.tsx
it will work.
Describe the bug
I'm trying to add Next to my existing NestJS project following the readme and basic example. I'm getting 404 for all pages.
My NestJS project is an example project following the getting started guide, so I imagined the integration to work out of the box. It uses the
nest
CLI forstart
andbuild
.I suspect the pages are not compiled, because I can't find them in the
.next
folder whereas running the basic example they're there. But I'm not sure how to adapt the existing setup using Nest CLI.Expected behavior
A description in the readme to explain the usage with Next defaults.
To Reproduce
Repository URL: https://github.com/thisismydesign/nestjs-playground/tree/668dec84d2ff6544a1bc2f57cd874e44e33443f7
Version
Additional context
Initial
tsconfig
:tsconfig
updated by Next: