kebab-case files not supported for islands
See original GitHub issueI started a project using the project creation tool and included twind for styling. I generally use kebab-case
for file names to avoid case clashing.
I have ran into an issue when running the locally (haven’t tried in deno deploy) where it’s using the name in the code.
But it’s getting Unexpected token '-'
as you can’t use a dash in a variable name/import reference.
Import of island in my code:
import DarkModeButton from "../islands/dark-mode-button.tsx";
Import in rendered code:
Error in console
Uncaught SyntaxError: Unexpected token '-' (at (index):64:12)
You can even rename the counter island that comes with the project to reproduce the issue.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Interactive islands | fresh docs - Deno Fresh
Islands are defined by creating a file in the islands/ folder in a Fresh project. The name of this file must be a...
Read more >mwood23/preact-island: Create your own slice of ... - GitHub
Does not mutate the window . Use as many islands as you'd like on one page! Less than 1.3kB; ☠️ Supports replacing the...
Read more >Hi team, i am getting 'No base file for markup:' when i try to ...
Hi Raj, i am not trying to invoke a component in the mark up. iam trying to deploy the one of the playground...
Read more >What the heck is Astro? - Deegloo
You write basic HTML with kebab-case attributes instead of camelCase which is used inside modern frameworks. HTML comments are valid inside ...
Read more >problem with spring boot 2.x kebab-case format - Stack Overflow
Is there a solution to this problem ? I assume you're using Spring Boot 2.x. It tightened up some of the rules around...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just don’t use a kebab-case. PascalCase is a generally accepted naming convention for
.tsx
/.jsx
components/islands. Doing otherwise, in my opinion, should be strongly discouraged in order to preserve the convention.It’s true that pascal case is an extremely pervasive convention, but it also is a source of a lot of last-minute bugs because different operating systems have different case sensitivity. It’s not a good convention, but even worse, there’s literally no reason to ban the one that is less error-prone.