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

Please don't use underscore at the beginning of the filenames that Kit produces #2707

Closed
frederikhors opened this issue Oct 29, 2021 · 15 comments

Comments

@frederikhors
Copy link
Contributor

frederikhors commented Oct 29, 2021

Describe the problem

As asked in #1370 please many of us ask you not to use underscore at the beginning of the name of the files that kit produces (there are many problems, with Golang but not only).

Describe the proposed solution

Don't use underscore but any other character (except .) or nothing at all, example: instead of __layout.js simply layout.js.

Importance

would make my life easier

@Hugome, @feedmeapples, @rohfle.

@benmccann
Copy link
Member

The related Go issue is marked as "Proposal Accepted," so it's marked to be fixed on their end. golang/go#43854 (comment)

Go should be fixed. We're not changing SvelteKit to workaround someone else's bug. Since there appears to be potential workarounds (see #1370 (comment)), and this issue is not actually a SvelteKit bug, closing.

@benmccann
Copy link
Member

Although it turns out this also affects Chrome extensions ☹️

Cannot load extension with file or directory name app. Filenames starting with "" are reserved for use by the system.
Could not load manifest.

@benmccann
Copy link
Member

Though luckily the Chrome extensions seem to be fine with a leading underscore in __layout.svelte and it's only the _app folder that it's complaining about. So I'm still not inclined to rename __layout.svelte, but maybe we could rename _app

@frederikhors
Copy link
Contributor Author

I don't understand why brilliant people who make brilliant products often show themselves as clumsy as an elephant in front of a mouse.

If the community asks you something so "simple" as to avoid using an underscore can you please consider it?

It is also a question of respect for those like me who have been trying to help you as and when they can for years.

What's bad if we don't use underscore for either files or folders? Does the world fall?

Or at least one option in svelte.config.js, please.

Not only Golang has problems, there is Chrome but also other debugging tools and even a proprietary operating system (another case of mine).

Excuse the tone but I am dejected and disappointed by certain hasty responses.

@benmccann
Copy link
Member

Changing it would break every existing SvelteKit application. Adding an option adds complexity. If someone comes to a new SvelteKit application it's harder to understand where the layouts are, it makes documentation and examples harder if people are doing it different ways, etc. I discussed this with the other maintainers and there's agreement that it should not change

I think we could change _app, but changing __layout would have too many ill effects. Better to invest the time into fixing Go

@frederikhors
Copy link
Contributor Author

Changing it would break every existing SvelteKit application.

Isn't that the point of the alpha versions?

Adding an option adds complexity.

I know and in fact I don't agree either. I consider it a last resort.

However, in my request I refer to the files generated in the svelte-adapter-static NOT IN THE USE of Kit with the .svelte files.

@frederikhors
Copy link
Contributor Author

I mean the generated files in the build folder with npm run build.

@benmccann
Copy link
Member

One is generated from the other. I don't know that it'd be that easy to change. I'm sure you could, but it adds more complexity and overhead. E.g. if you're looking at the output file it's harder to tell where it came from if the name doesn't match the input file, you could end up having two files trying to write to the same place, etc. I don't think it'd necessarily be easier than fixing Go and is less correct of a solution

@jamess-ais
Copy link

Has this been fixed at all? Having issues with this still 1.5 years later? Has anyone found any work around? The best I've found is manually renaming _layout to layout. Wish it were an option!

@benmccann
Copy link
Member

The linked Go issue was closed a year and a half ago: golang/go#43854. Maybe you need to upgrade?

@jamess-ais
Copy link

Oh. Interestingly files with a leading underscore aren't allowed on GitHub pages, so I've been having a similar issue from the same root cause. Glad it's fixed for you guys! For now I have it working for me by manually renaming.

@benmccann
Copy link
Member

@jamess-ais you can just create a .nojekyll file: https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/

@jamess-ais
Copy link

I may have placed the file in the wrong place! My bad!

@francoisschwarzentruber
Copy link

I am also stuck because of the underscores in _app. I could change it manually or I do not know. And the .nojekyll file does not work for me. :( Having an option for changing the name of the _app folder would be nice. I do not think having a lot of options makes Sveltekit complicated to use, as long as the name of the options and the documentation are clear.

My repo is here: https://github.com/playwithalgos/dft-visualisation
And I do not see my app here: https://playwithalgos.github.io/dft-visualisation/build/ while it works locally.

If it is not working soon, I will probably switch to standard sveltejs.

@francoisschwarzentruber

I was unable to fix the error. So I decided to use sveltejs instead of sveltejs/kit.

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

4 participants