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.

[labs/react] Warning: Invalid attribute name: `_$Gl`

See original GitHub issue

Which package(s) are affected?

React (@lit-labs/react)

Description

When using a ref with a react wrapper around my Lit component:

<MyReactWrapper ref={console.log} />

I see the following error logged in the console:

Warning: Invalid attribute name: `_$Gl`

After doing some digging, this identifier _$Gl appears in the minified published code of @lit-labs/react. In the source this corresponds to __forwardedRef.

I am wondering if the minification has been overly aggressive and has mangled the property?

Previously i raised an issue relating to refs causing an l attribute to appear in DOM: https://github.com/lit/lit/issues/2593

It seems like this is the same bug, but now instead of the incorrectly adding a valid attribute name, it is incorrectly adding an invalid attribute name

Reproduction

Check the console here: https://stackblitz.com/edit/react-ts-1d2hjj?file=App.tsx%3AL9

Workaround

n/a

Is this a regression?

No or unsure. This never worked, or I haven’t tried before.

Affected versions

1.0.8

Browser/OS/Node environment

Browser: Chrome 105.0.5195.125

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
WickyNilliamscommented, Nov 8, 2022

Awesome thanks! I’ve had a few developers ask me why this was getting logged by our design system. Will keep and eye out for the release, then test and report back 👍

0reactions
taylor-vanncommented, Nov 8, 2022

#3408 was the more durable option, and yes it resolves this issue 😃 This will be apart of the next Lit release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: Invalid attribute name: `'data-name'` · Issue #108
So everytime I add a new .svg file to the project I get this warning and I have to fiddle around with the...
Read more >
Warning: Invalid attribute name: `'data-*'` - Stack Overflow
I ran into a similar issue and was able to resolve by updating plugins in my .babelrc file. I updated it to match...
Read more >
HWNDA0008E The specified attribute invalid attribute name is ...
Explanation. The attribute that is specified is not in the list of usable attributes for the method that is being invoked.
Read more >
Developer Corner - Invalid attribute name - Sitemorse
Diagnostic: file/html/badattr: Invalid attribute name. This is a Sitemorse Code Quality error that is raised when an invalid attribute is ...
Read more >
reagent 2021-09-02 - Slack Archive
Hello , what does this error means? react_devtools_backend.js:2850 Warning: Invalid attribute name: `cljs$lang$protocol_mask$partition0$` at ...
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