Open antony opened 4 years ago
This gotcha is already documented here. We can handle page routes by making them all be folders containing index.html
files, but that doesn't work well with server routes, because we probably can't rely on static servers having the same index.*
handling for other file types.
Ah, yes I hadn't quite understood that the route conflicts section pertained to this specific problem.
I wonder if there's a better way to warn the user than just throwing an error.
Describe the bug A bit of a mouthful.
If I have:
The final server route ([slug].js) will fail to export with an error ENOTDIR.
The reason being that the following directory structure has been exported:
which should be a [DIR] so that the nested routes can be exported to it.
Logs
To Reproduce Create a directory structure as above. Having some machine issues right now so I can't create a repo, but it is inbound asap.
Expected behavior I'm not exactly sure. I think that the
index
route should probably end up in anindex
file insidesomedir
so that the rest of the routes can be exported.Information about your Sapper Installation:
Your operating system: Ubuntu 19.04
Sapper version: 0.29.12
Exported app
Rollup
Severity I'm fairly sure I can work around it, but it's a problem for new users. I also know that it has caused a problem for the folk over at sanity.io, since their Sapper template doesn't actually result in a true static site, and you end up getting a couple of API requests per view which can rack up. I've raised https://github.com/sanity-io/sanity-template-sapper-blog/issues/42 which I am trying to fix.