Skip to content

Identifier 'document' has already been declared #930

@songyajie

Description

@songyajie

Initial checklist

Affected package

[email protected] [email protected]

Steps to reproduce

<ReactMarkdown
remarkPlugins={[RemarkMath, [RemarkGfm, { singleTilde: false }], RemarkBreaks]}
rehypePlugins={[
RehypeKatex,
[
RehypeHighlight,
{
detect: false,
ignoreMissing: true
}
]
]}
components={{
pre: PreCode,
p: (pProps) => <p {...pProps} dir="auto" />,
a: (aProps) => {
const href = aProps.href || ''
const isInternal = /^/#/i.test(href)
const target = isInternal ? '_self' : aProps.target ?? '_blank'
return <a {...aProps} target={target} />
},
code: (cProps) => {
if (cProps.inline) {
//
}
return <code {...cProps} />
}
}}
>
{escapedContent}

Actual behavior

When starting a React project, an error always occurs: "Identifier 'document' has already been declared", which prevents the project from launching.

Expected behavior

run normally

Runtime

[email protected]

Package manager

No response

Operating system

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🤷 no/invalidThis cannot be acted upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions