-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 when trying to run the create-react-app example #365
Comments
The mdx.macro should read the Content file from /src but seems to look locally in the node_modules/.cache/mdx.macro folder. |
I am seeing the same behavior. Did you have any luck? |
I ejected and used the nom package @mdx-js/loader. The CRA docs should be updated to mention that they don't currently work with mdx.macro. |
I got this error, any fix planned without ejecting ? |
My guess is it's this line in |
I am experiencing the same issue on macOS 10.14.3 so it's not a Windows issue. I tried setting up a new CRA app using the latest mdx package with a simple import - issue raised for mdx.macro |
I'm getting this error on Windows with a pristine CRA --typescript project. |
Getting this issue then on a newly created project following the doc - my env is Windows. |
I don't understand why this issue is still open since Dec 22, 2018.
The top line is fine, the bottom line is just plain wrong? This should be a easy fix for a maintainer right? Meanwhile it's stopping everyone trying this out on Windows, following the documented advice to use mdx.macro for create-react-app projects. The above fixes seem either very radical (ejecting) and outdated (using .env file). I'm sorry for sounding harsh, maybe I'm missing something? Please help me understand Edit: just to add to the pool of solution. Using WSL can solve this problem. It's a bit slower, and even more so if you keep the folder where it is, so I suggest moving the folder to the WSL home directory. |
mdx.macro is not maintained here. There is a stalled PR (#589) to change the suggestion in this example. As for “why is this still a problem”, well, the usual: oss, priorities, real life, etc etc etc. If someone wants to work on a PR to change the docs, that would be greatly appreciated |
This PR example doesn't work for me when applied to my cra project:
|
@thediveo that is a lint warning, not a webpack error. |
Using "// eslint-disable-next-line import/no-webpack-loader-syntax" immediately before the import now results in "Cannot find module '!babel-loader!mdx-loader!./About.mdx' or its corresponding type declarations.ts(2307)" |
@thediveo I can't speak the the specifics how you have your TSConfig setup, but it can work with webpack and typescript . |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ChristianMurphy thank you very much, will try mdx2 and as a fallback I can always rename the affected .tsx module to .jsx to work around the typescript error. |
Create React App is the most looked at resource by users here on GitHub. But it’s suggesting an old, unmaintained, and buggy way to use MDX. This instead updates the guide to use our maintained projects, without having to eject from CRA. As CRA itself is an ever-changing “init” tool, which can support MDX by following a couple steps, I don’t think it’s wise to have an example in the project: we want folks to do `npx create-react-app ...`, not clone our custom example. Not having CRA checked in also makes for a faster `yarn install`. Perhaps developing our own [CRA template](https://create-react-app.dev/docs/custom-templates) might be nice for the future, but for now I’ve kept it at an up to date and working guide. Related to GH-1015. Related to GH-1388. Closes GH-365. Closes GH-589.
Create React App is the most looked at resource by users here on GitHub. But it’s suggesting an old, unmaintained, and buggy way to use MDX. This instead updates the guide to use our maintained projects, without having to eject from CRA. As CRA itself is an ever-changing “init” tool, which can support MDX by following a couple steps, I don’t think it’s wise to have an example in the project: we want folks to do `npx create-react-app ...`, not clone our custom example. Not having CRA checked in also makes for a faster `yarn install`. Perhaps developing our own [CRA template](https://create-react-app.dev/docs/custom-templates) might be nice for the future, but for now I’ve kept it at an up to date and working guide. Related to GH-1015. Related to GH-1388. Closes GH-365. Closes GH-589.
Create React App is the most looked at resource by users here on GitHub. But it’s suggesting an old, unmaintained, and buggy way to use MDX. This instead updates the guide to use our maintained projects, without having to eject from CRA. As CRA itself is an ever-changing “init” tool, which can support MDX by following a couple steps, I don’t think it’s wise to have an example in the project: we want folks to do `npx create-react-app ...`, not clone our custom example. Not having CRA checked in also makes for a faster `yarn install`. Perhaps developing our own [CRA template](https://create-react-app.dev/docs/custom-templates) might be nice for the future, but for now I’ve kept it at an up to date and working guide. Related to GH-1015. Related to GH-1388. Closes GH-365. Closes GH-589. Closes GH-1422. Reviewed-by: Christian Murphy <[email protected]>
Subject of the issue
I get an error when trying to run the create-react-app example.
Your environment
Windows 10
Node v10.14.0
NPM 6.4.1
Steps to reproduce
Easy. I do:
git clone
cd mdx/examples/create-react-app
npm i
npm start
Expected behaviour
The app should run without errors.
Actual behaviour
I get this error when running the app;
The text was updated successfully, but these errors were encountered: