web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] Property 'w3m-button' does not exist on type 'JSX.IntrinsicElements'.

Open mdesousa opened this issue 1 year ago • 1 comments

Link to minimal reproducible example

https://docs.reown.com/appkit/react/core/installation

Summary

Hi, we are following the steps in the installation. We use vite and typescript and are trying to use the w3m-button component as shown towards the end. The application actually works when we run npm run dev but it won't build in typescript and gives the following error: Property 'w3m-button' does not exist on type 'JSX.IntrinsicElements'.

Are there any extra-steps missing that are needed to make the build aware of the w3m-button component?

Thanks!

List of related npm package versions

@reown/[email protected] @reown/[email protected] [email protected]

mdesousa avatar Oct 16 '24 00:10 mdesousa

i think i found the solution, just add an import to my project as follows:

import '@reown/appkit/react';

mdesousa avatar Oct 16 '24 12:10 mdesousa

I received this error Property 'w3m-button' does not exist on type 'JSX.IntrinsicElements'

after upgrading from nextjs 14 --> 15 and react 18 -> 19-rc

x0good avatar Oct 29 '24 15:10 x0good

@x0good idk if still relevant for you, but the w3m naming is deprecated in favour of appkit. So appkit-button.

webel avatar Nov 10 '24 10:11 webel

@webel yes, with appkit-button the same warning in vscode

Property 'appkit-button' does not exist on type 'JSX.IntrinsicElements'

x0good avatar Nov 10 '24 14:11 x0good

bump, same still

elix1er avatar Nov 15 '24 08:11 elix1er

Anyone has a fix for this? Can´t find where to import this components with appkit and vercel build breaks..

DrHongos avatar Dec 14 '24 02:12 DrHongos

I reckon you add it to some global.d.ts, something like

declare global {

  namespace JSX {

    interface IntrinsicElements {

      'appkit-button':
React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;

    }

  }

}

On Sat, Dec 14, 2024 at 3:49 AM Lucas Ziegenfuhs @.***> wrote:

Anyone has a fix for this? Can´t find where to import this components with appkit and vercel build breaks..

— Reply to this email directly, view it on GitHub https://github.com/reown-com/appkit/issues/3093#issuecomment-2542687713, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABANI4ADULDF7N5CC4BPKPL2FOMDHAVCNFSM6AAAAABQAJ2KWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBSGY4DONZRGM . You are receiving this because you were mentioned.Message ID: @.***>

webel avatar Dec 14 '24 14:12 webel

For anyone still struggling with this, I found that adding these ignore statements works. Seems to work for w3m-button also.

<div>
   {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
   {/* @ts-ignore */}
   <appkit-button/>
</div>       

DocBadTouch avatar Dec 23 '24 17:12 DocBadTouch

Same issue here with Nextjs15 react 19. Property 'appkit-button' does not exist on type 'JSX.IntrinsicElements'

dylanngph avatar Dec 24 '24 08:12 dylanngph

Yeah +1 on this issue.

tunarollchef avatar Jan 04 '25 01:01 tunarollchef

Same issue here

Q6Crypto avatar Jan 12 '25 02:01 Q6Crypto

Added how to solve this issue to next/react docs and into the next example ...

rtomas avatar Feb 06 '25 03:02 rtomas