Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Unable to dynamic import in MDX with NextJS #1

Open
@MatthewCaseres

Description

@MatthewCaseres

Tried to use a dynamic import in mdx file.

let Editor = dynamic(() => import("react-run-code"), {
  ssr: false,
});

<Editor
  id="10"
  modelsInfo={[{"filename":"typeof.js","value":"let fromLet = \"from let\"\r\nconst fromConst = \"from const\"\r\nfromLet = \"reassign let\"\r\nconsole.log(fromLet)\r\nfromConst = \"this will cause an error\"","language":"javascript"}]}
/>

Received "Syntax error: Identifier 'Editor' has already been declared"

The fix here is probably to make it so the component works without a dynamic import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions