You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the browser loads localhost:3000 after executing yarn start, it shows a blank page. Hit refresh and the content appears.
When you edit the content of test.mdx, the page refreshes (as the macro adds an import for the test.mdx file). However, the macro is not called again, so the old content is displayed.
I'm pretty out of my depth here, but I don't think the babel cache is the problem. I've tried cleaning the cache manually (rm node_modules/.cache/babel-loader/*) and then editing the markdown file. When I do, the page reloads, but the cache directory stays empty.
I think it's webpack itself that's deciding not to pass the App.js file through any loaders.
The macro follows the pattern mentioned by @kentcdodds where it creates a temporary file and imports that. The generated file then imports the original MDX file so that webpack will notice changes and rebuild (but only in development mode -- don't worry).
Would love to hear any ideas for getting this working, as being able to use MDX files without ejecting would be 👌, but no refresh-on-change is a bit of a deal breaker.
Is this a bug report?
I'm not sure if this is a bug in create-react-app, a bug in my macro, or if this is the intended behavior.
Did you try recovering your dependencies?
This occurs in a fresh build using yarn version 1.9.4. I've tried with react-scripts 2.0.5 and 2.0.0
Environment
Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
Binaries:
Node: 10.10.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 62.0.3
Safari: 12.0
npmPackages:
react: ^16.6.0 => 16.6.0
react-dom: ^16.6.0 => 16.6.0
react-scripts: ^2.0.5 => 2.0.5
npmGlobalPackages:
create-react-app: 2.0.4
Steps to Reproduce
To make the changes from a fresh create-react-app install:
yarn add mdx.macro(see the package source)src/test.mdx# Hello, worldApp.jswith:Expected Behavior
App.jsfile that calls the macro.Actual Behavior
yarn start, it shows a blank page. Hit refresh and the content appears.test.mdx, the page refreshes (as the macro adds an import for thetest.mdxfile). However, the macro is not called again, so the old content is displayed.Reproducible Demo
https://github.com/jamesknelson/mdx-cra-demo
Thoughts
I'm pretty out of my depth here, but I don't think the babel cache is the problem. I've tried cleaning the cache manually (
rm node_modules/.cache/babel-loader/*) and then editing the markdown file. When I do, the page reloads, but the cache directory stays empty.I think it's webpack itself that's deciding not to pass the
App.jsfile through any loaders.The macro follows the pattern mentioned by @kentcdodds where it creates a temporary file and imports that. The generated file then imports the original MDX file so that webpack will notice changes and rebuild (but only in development mode -- don't worry).
Would love to hear any ideas for getting this working, as being able to use MDX files without ejecting would be 👌, but no refresh-on-change is a bit of a deal breaker.