Crook
Crook
NNuxt
Created by Crook on 1/12/2025 in #❓・help
Server api nested index.js file is not detected
For future readers, I think I may have figured this out. In my structure, I had two dynamic route params, one for the projectId and one for the pebbleId. When I made the projects directory, i made a index.js and a [id].js file within. Then I needed nested routes, and added a [projectId] directory, in which I added the pebbles stuff. It seems that somehow, the naming of the [id].js file, created a conflict. I renamed the [id].js file in my projects folder, to [projectId].js, so it matched the name of the sibling folder. Now in my pebbles directory, I have index.js and [pebbleId].js and both seem to work. I'm not 100% certain that I'm correct about this, but it seems that the missmatch of the file and directory for the project, was causing problems for the dynamic routes nested beneath it. Will avoid using generic name like [id] in the future and always name the dynamic file and potential dynamic subfolder the same.
9 replies
NNuxt
Created by Crook on 1/12/2025 in #❓・help
Server api nested index.js file is not detected
While the AI answer is nice, it did not suggest anything that I have not already looked at, so I would appreciate if anyone is able to spot a flaw in my structure etc.
9 replies