404 on dynamic routes or path error using urls
See original GitHub issueHello guys,
i’m facing a little problem since many days now and i don’t figure how to fix it.
I have /pages/views/publication/[slug].tsx, when i try to access it using Link or by the direct url link, i got a : Error: The provided as
value (/publication/my-super-url) is incompatible with the href
value (/views/publication/[slug]);
to access it by Link i use :
<Link href={
views/publication/[slug]} as={
/publication/${publication.slug}}></Link>
since the error comes from the incompatible href, i tried to change the viewsDir and set it to null and see if i can play with the paths. After setting the path to null and moved my folder to pages/publication/[slug].tsx it works, but i would like to put it in pages/views
my app.controller with viewDir set to null:
@Get('publication/:slug')
@Render(`publication/[slug]`)
public publicationSlug() {}
Version next: 9.5.5 nest-next: 9.3.0 nest: 6.13
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
After some rework, i found that the issue were coming from the implementation of :
i don’t know why the error talk about path and why this piece of code is defective but what ever… so i replaced it with getInitialProps and everything works as expected.
Thanks for your help and keep the good work 👍
Okay I am having a little trouble helping since I don’t have access to your code.
First, can you look at the example that I provide in the basic example? The immediately relevant files are listed below, but you may want to check and make sure the config is the same (for example I don’t change the viewsDir).
If you still have issues after that, can you provide a minimal example as a git repository detailing the issue? I can clone it then and try to provide some additional help. I won’t be able to immediately do this but should have some free time in the next couple of days.