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.

Unknown utility "class-name"

See original GitHub issue

For some reason, this…

// components/SidebarIcon.tsx

/** @jsx h */
import { h } from "preact";

export function SidebarIcon(props: {iconName: string}) {
  return (
    <div className="sidebar-icon">
      {props.iconName}
    </div>
  );
}

…gives me this error from TypeScript in VSCode:

Unknown utility "sidebar-icon" ts(-2020)

I have a feeling that might be caused by Twind because if I use one of its classes — everything is fine. Am I not allowed to create my own classes if I use Twind?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lucacasonatocommented, Jul 6, 2022

This seems like something you’d want to report to the twind folks.

1reaction
synalicecommented, Jul 5, 2022

I understood the source, but not the reason of the issue.

To solve the https://github.com/denoland/fresh/issues/425, I created this file:

// config/twind.config.ts

/** @jsx h */

/** @type {import('twind').Configuration} */

It solved the issue of autocomplete not working for the Twind, but at the same time introduced the above Unknown utillity error. Deleting this config/twind.config.ts file solves the issue, but breaks autocomplete.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom classnames "unknown or invalid utility" #121 - GitHub
"test" unknown or invalid utility. I created my App with expo wich seems to use this version of react native "react-native": "0.64.3"
Read more >
Unknown class 'name' - java - Stack Overflow
1 Answer 1 ; MainActivity extends ; protected void ; super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ; = ...
Read more >
Adding Custom Styles - Tailwind CSS
Best practices for adding your own custom styles to Tailwind.
Read more >
Utility API · Bootstrap v5.0
The utility API is a Sass-based tool to generate utility classes. ... List of values, or a map if you don't want the...
Read more >
ClassName (SpotBugs 3.1.5 API) - javadoc.io
public abstract class ClassName extends java.lang.Object. Utility methods for working with class names. Author: David Hovemeyer ...
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