Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with sveltekit #18

Open
elron opened this issue May 25, 2022 · 1 comment
Open

Doesn't work with sveltekit #18

elron opened this issue May 25, 2022 · 1 comment

Comments

@elron
Copy link

elron commented May 25, 2022

I get this error:

import CopyToClipboard
Element does not support attributes because type definitions are missing for this Svelte Component or element cannot be used as such.

Underlying error:
JSX element class does not support attributes because it does not have a '$$prop_def' property.ts(2607)
'CopyToClipboard' cannot be used as a JSX component.
  Its instance type 'CopyToClipboard' is not a valid JSX element.
    Property '$$prop_def' is missing in type 'CopyToClipboard' but required in type 'ElementClass'.

My package.json file:

{
	"name": "copypost",
	"version": "0.0.1",
	"scripts": {
		"dev": "svelte-kit dev",
		"build": "svelte-kit build",
		"package": "svelte-kit package",
		"preview": "svelte-kit preview",
		"prepare": "svelte-kit sync",
		"check": "svelte-check --tsconfig ./jsconfig.json",
		"check:watch": "svelte-check --tsconfig ./jsconfig.json --watch"
	},
	"devDependencies": {
		"@sveltejs/adapter-auto": "next",
		"@sveltejs/kit": "next",
		"@types/cookie": "^0.4.1",
		"svelte": "^3.46.0",
		"svelte-check": "^2.2.6",
		"typescript": "~4.6.2"
	},
	"type": "module",
	"dependencies": {
		"@fontsource/fira-mono": "^4.5.0",
		"@sveltejs/adapter-static": "^1.0.0-next.32",
		"cookie": "^0.4.1",
		"html-to-text": "^8.2.0",
		"node-sass": "^7.0.1",
		"sass": "^1.52.1",
		"svelte-copy-to-clipboard": "^0.2.5",
		"svelte-preprocess": "^4.10.6"
	}
}

@0gust1
Copy link

0gust1 commented Dec 26, 2023

Would close:

  • it's been a long time
  • it works perfectly with sveltekit (from early beta to the latest v2)
  • the message JSX element class does not support attributes because it does not have a '$$prop_def' property.ts(2607) 'CopyToClipboard' cannot be used as a JSX component. strongly hints toward a misconfiguration on the computer of the OP (sveltekit doesn't mess with JSX)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants