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

error on simply import runtime in create-react-app v1 #281

Closed
naivefun opened this issue Oct 2, 2018 · 3 comments
Closed

error on simply import runtime in create-react-app v1 #281

naivefun opened this issue Oct 2, 2018 · 3 comments
Labels
🐛 type/bug This is a problem

Comments

@naivefun
Copy link

naivefun commented Oct 2, 2018

import MDX from "@mdx-js/runtime";

then I get, 0.15.4 and tried 0.15.0

./node_modules/@mdx-js/mdx/mdx-hast-to-jsx.js
Module parse failed: Unexpected token (21:6)
You may need an appropriate loader to handle this file type.
|     const paramCaseRe = /^(aria[A-Z])|(data[A-Z])/
|     node.properties = Object.entries(node.properties).reduce((properties, [key, value]) => ({
|       ...properties,
|       [paramCaseRe.test(key) ? paramCase(key) : key]: value,
|     }), {})
@silvenon
Copy link
Contributor

silvenon commented Oct 2, 2018

This error is probably specific to your setup, in CodeSandbox it works fine. Could you provide a repository reproducing this issue?

@naivefun
Copy link
Author

naivefun commented Oct 2, 2018

mdx-runtime.zip

the attached is a create-react-app without any modification except for adding runtime dependency. If you run yarn and yarn start it should throw the error.

@silvenon
Copy link
Contributor

silvenon commented Oct 2, 2018

This works in create-react-app v2, but I submitted a PR to fix this for v1.

@silvenon silvenon added the 🐛 type/bug This is a problem label Oct 2, 2018
@silvenon silvenon changed the title error on simply import runtime error on simply import runtime in create-react-app v1 Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug This is a problem
Development

No branches or pull requests

2 participants