question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kebab-case files not supported for islands

See original GitHub issue

I 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: Screenshot 2022-07-04 at 00 31 04

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:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
synalicecommented, Jul 5, 2022

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.

3reactions
thebearingedgecommented, Jul 7, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found