The version of react-is that is used by hoist-non-react-statics does not match the version defined in its package.json.
This does not happen when built locally with [email protected]. I suspect the node_modules/ layout created by the client is wrong. There is probably another dependency on react-is from another package that does not semver match the version required from hoist-non-react-statics.
Running the linked sandbox.
| Software | Name/Version|
| ---------------- | ---------- |
| 小odesandbox | PROD-1549276057-35219357
| Browser | Chrome Version 72.0.3626.81 (Official Build) (64-bit)
| Operating System | Ubuntu 18.04.1 LTS
I'm having the same problem!
workaround suggestions anyone?
Looking at it now. This is the information of react-is in the sandbox:
resolved: "16.7.0"
semver: "^16.6.3"
So this means that the requested version by hoist-non-react-statics is ^16.6.3, and the resolved version is 16.7.0, which is correct. isMemo got added in 16.8.1.
So I believe that what we're doing is correct, but we have a different (but compatible) result compared to yarn.
Another fix outside of CodeSandbox would be for hoist-non-react-statics to pin react-is to ~16.8.1.
I can take a closer look tomorrow and figure out if we can have a closer result to yarn so we can fix it on our side.
isMemogot added in16.8.1
Where did you get that information? It was in the code in 16.7.0 and it was published in 16.7: https://www.npmjs.com/package/react-is/v/16.7.0https://www.npmjs.com/package/react-is/v/16.7.0
hoist-non-react-static is declaring 16.7 as a direct dependency
So I believe that what we're doing is correct, but we have a different (but compatible) result compared to
yarn.
yarn is causing no error. So while you are right that it is (obviously) different it is not compatible.
Ahh, you're right. Thanks for correcting me!
So what I'm seeing is that we got the wrong semver for react-is. @material-ui/utils specifies it needs ^16.6.3 while hoist-non-react-static in @material-ui/core specifies it needs ^16.7.0. We took priority with ^16.6.3 while we should've used ^16.7.0.
I'll check the code that merges these dependencies.
I found the problem and I'm deploying a fix now. The problem was related to replacing the file contents with the correct version (I think @eps1lon was already on to this). I fixed it with this commit https://github.com/codesandbox/dependency-packager/commit/a82f30de8eaf5213b38a72f1e9d25785547a6ec6.
Purging the cache will be challenging, I'm going to try something.
It seems to be working when adding a new dependency to generate a new cache: https://codesandbox.io/s/13jx2l8qz4
I have been applying for jobs and using Codesandbox links as portfolio for the past few days.
Been wondering why I was not getting any responses until some kind soul alerted me that those links were not even compiling.
Obviously everyone else just assumed this was some sloppy mistake in own code.
Hope this gets fixed soon.
I'm sorry that that happened to you. The error is already fixed, you may have to refresh twice to force the service worker to download a new version.
You might try a hard reload, If you're on chrome/firefox then it's cmd + shift + R.
Hmm, seems like the CDN hasn't finished invalidating the cache yet. It should be propagated soon to all sandboxes.
To make it work immediately you could upgrade a dependency, like react, to a newer version. That will force the bundler to generate a new dependency bundle.
I had to add "hoist-non-react-statics": "3.3.0", in the dependencies to make it work. Clearing my service workers didn't help.
Most helpful comment
I had to add
"hoist-non-react-statics": "3.3.0",in the dependencies to make it work. Clearing my service workers didn't help.