If you're running into an error that looks similar to this one
It's possible your site is has some outdated packages. This error comes from gatsby-core-utils
which gatsby-source-contentful
is using. Notice that there's a -1
at the end of the highlighted line. This issue will always show up with a dash and then a number in this part of the error.
1. Upgrade your packages
The first thing to try is to upgrade all your npm packages to their latest versions. If you're using yarn you can run yarn upgrade-interactive --latest
to get an interactive CLI to help you upgrade all packages. Press up/down on your keyboard and then space to select which packages to upgrade, then press enter to upgrade.
If this doesn't solve your problem, try deleting your package-lock.json
or yarn.lock
file before re-installing and pushing up a new commit to your site.
2. Fix duplicate and/or nested dependencies
At this point if it's still not working there's likely a nested dependency in your site which is installing an old version (or multiple versions) of gatsby-core-utils
.
You can identify which versions are installed and which packages are depending on them by running yarn why gatsby-core-utils
(or by using the npm-why package if you're using npm). You should see a long list of dependencies and versions similar to this:
The version of gatsby-core-utils
in which this issue was fixed was 3.1.2
so if you see any older versions listed this will help you understand which package is installing that version.
To attempt to solve the problem from here you can use the yarn deduplicate package or the npm dedupe
command.
Alternatively if you're using yarn, you can add a yarn resolution to your package.json to force using a version that doesn't have this problem:
Comments
0 comments
Please sign in to leave a comment.