redoc icon indicating copy to clipboard operation
redoc copied to clipboard

'$mobx' is not exported from 'mobx'.

Open dillonredding opened this issue 6 years ago • 3 comments

I'm unable to get this working in a React app. I ran the following to create a new react app and add redoc:

npx create-react-app my-app
cd my-app
npm i redoc mobx@^4.2.0 styled-components core-js

Then I added a spec file at /public/specs/spec.yaml and updated App.js to

import React from 'react';
import { RedocStandalone } from 'redoc';

function App() {
  return (
    <RedocStandalone specUrl="/specs/spec.yaml" />
  );
}

export default App;

After running npm start, I get the following:

Failed to compile.

./node_modules/redoc/node_modules/mobx-react/dist/mobxreact.esm.js
Attempted import error: '$mobx' is not exported from 'mobx'.

dillonredding avatar Feb 27 '20 23:02 dillonredding

It seems to me that mobx 5+ is required, or at least the README needs some additional instructions.

This worked for me without the version range, (make sure mobx 5 installs): npm i redoc mobx styled-components core-js

BenRussert avatar Mar 31 '20 20:03 BenRussert

It seems to me that mobx 5+ is required, or at least the README needs some additional instructions.

This worked for me without the version range, (make sure mobx 5 installs): npm i redoc mobx styled-components core-js

I have the same issues and it persists after installing mobx 5+ ([email protected])

lucaceriani avatar Apr 11 '20 19:04 lucaceriani

Thanks for reporting this, the current versions seem to be working correctly, and this issue has been open a while. I'll close it but please let us know if you see this again?

lornajane avatar Jul 26 '23 15:07 lornajane