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

Custom attributes like repo on Next/Script for using Utterances gives TypeScript error #26236

Closed
deadcoder0904 opened this issue Jun 17, 2021 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@deadcoder0904
Copy link

What version of Next.js are you using?

11.0.0

What version of Node.js are you using?

16.1.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next start

Describe the Bug

I am using Utterances → https://utteranc.es/ to display comments on my blog & thought of using the new Script tag as follows:

import Head from 'next/head'
import Script from 'next/script'

export const Comments = () => {
	return (
		<Head>
			<Script
				src="https://utteranc.es/client.js"
				strategy="lazyOnload"
				repo="deadcoder0904/comments.akshaykadam.com"
				issue-term="pathname"
				theme="photon-dark"
				crossorigin="anonymous"
			/>
		</Head>
	)
}

I plan to include this Comments component under my blog post but it gives red-squiggly lines on repo.

Idk how to use Script tag but the above code seems okay.

The TS error I get in VSCode is:

Type '{ src: string; strategy: "lazyOnload"; repo: string; "issue-term": string; theme: string; crossorigin: string; }' is not assignable to type 'IntrinsicAttributes & Props'.
Property 'repo' does not exist on type 'IntrinsicAttributes & Props'.ts(2322)

How do I get it working?

Expected Behavior

It should work.

To Reproduce

Just try pasting the above code in a Next.js app :)

@deadcoder0904 deadcoder0904 added the bug Issue was opened via the bug report template. label Jun 17, 2021
@styfle
Copy link
Member

styfle commented Jul 7, 2021

Closing, see #26290 (comment)

@styfle styfle closed this as completed Jul 7, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants