-
-
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
Dependency conflict with outdated "core-js" for "@mdx-js/tag" package #271
Comments
Wow, thanks for doing all that work to pin down the problem! I vote for locking React to v16.3+ and using the native Context API. @timneutkens? |
Actually, let me take a few steps back. @arcticicestudio could you explain where you see that error? I tried running your demo both in development and production and I don't see it, the title is showing normally. |
@silvenon Thanks for your feedback 👍 I've tested it again by downloading my demo codesandbox and running Here are some of my specs: OS: Arch Linux |
Thanks! I managed to reproduce the error with npm, but with Yarn everything works fine. 🤔 It seems like this might be an edge case with npm (gatsbyjs/gatsby#7862), which is why I'm not inclined to add any workarounds in this package until we can prove that the error is legitimate, i.e. that npm is resolving these dependencies correctly. In the meantime, I'm closing this, but I'm open for further discussion if you know that the error isn't npm's fault and wish to investigate this deeper. ⭐️ |
I think the problem can be led back to the Babel 7 changes for the |
First things first: Thanks for your great work, I love MDX and migrated all my projects to it. Finally writing Markdown and adding dynamic/non-specification via React elements to it is what I've always wanted to create content 😄
I working on one of my favorite projects again after a long time and started with updating from the Gatsby v2 Beta to the stable v2 release. This also included all the other outdated dependencies one-by-one for easier debugging when an error occurs and unfortunately it then failed with the following:
I've debugged and burrowed down the dependency tree and came to the decision that the error must be caused by the
@mdx-js/tag
package.As you can see on the screenshot the
@mdx-js/tag
package depends oncreate-react-context@^0.2.2
which resolves to[email protected]
. The package in turn depends on an outdated0.x.x
version offbjs
(^0.8.0
, latest stable version is1.0.0
) which resolves to[email protected]
.Now the
fbjs
package finally depends on thecore-js
package which module has not been found causing the error to be thrown. This outdated version offbjs
(0.8.17
) depends on the outdated packagecore-js@^1.0.0
, but the latest version is a new major release of2.5.7
. This latest version is also used by other dependencies as you can see on the screenshot including the latest Gatsby version (via the latest Babel v7@babel/polyfill
).The problem can now be nailed down to the fact that
[email protected]
does not provide theArray.filter
polyfill. The first version providing it is[email protected]
.Here is a example Codesandbox which reproduces the problem. Note that it can not be run within the browser because of Gatsby. Just copy/download/fork/clone it and run it locally via
npm run dev
.I solved the problem with an workaround by just adding
@babel/polyfill
(orcore-js
directly) todevDependencies
in my project. This resolves the correct required version ofcore-js
to fix the error.I currently don't know how to solve the problem here for the
@mdx-js/tag
package. Adding@babel/polyfill
orcore-js
as (peer) dependency might now be a good idea, but removingcreate-react-context
might be a better solution.Is it a problem to increase the required React version to 16.3+ to use the native Context API implementation instead of using a polyfill package? This might be the best solution, but this would be a breaking change =/
The text was updated successfully, but these errors were encountered: