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

Unable to dynamic import in MDX with NextJS #1

Open
MatthewCaseres opened this issue Nov 12, 2020 · 1 comment
Open

Unable to dynamic import in MDX with NextJS #1

MatthewCaseres opened this issue Nov 12, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@MatthewCaseres
Copy link
Owner

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.

@MatthewCaseres MatthewCaseres added the bug Something isn't working label Nov 12, 2020
@MatthewCaseres
Copy link
Owner Author

This enhancement should fix the issue: #2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant