Deprecated dependencies on `gatsby-source-graphql`
See original GitHub issuePreliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
Using latest version of gatsby-source-graphql
(4.2.0) causes an error to be thrown on running develop
.
The error is:
npm run develop
> gatsby@1.0.0 develop
> gatsby develop
success open and validate gatsby-configs, load plugins - 0.109s
success onPreInit - 0.001s
ERROR
(node:56888) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./public/" in the "exports" field module resolution of the package at
.../gatsby/node_modules/extract-files/package.json.
Update this package.json to use a subpath pattern like "./public/*".
(Use `node --trace-deprecation ...` to show where the warning was created)
A further investigation led me to see that the issue comes from extract-files@9
but is solved in 10.
I could found the root of this issue and it seems is a chain of dependencies issue, unfortunately.
The package gatsby-source-graphql
is using @graphql-tools/links@7.1.0
.
And @graphql-tools/links@7.1.0
is using apollo-upload-client@14.1.3
. In this version we can see apollo-upload-client
is using extract-files@9.0.0
.
Although the issue you reported is solved in extract-files@10.0.0
, which is also solved in apollo-upload-client@15.0.0
. https://github.com/jaydenseric/extract-files/issues/18
Since @graphql-tools/links
is now on 8.2.1
and is using apollo-upload-client@^16.0.0
I believe an upgrade on dependencies should solve the issue.
Reproduction Link
https://github.com/joselcvarela/gatsby-source-graphql-issue
Steps to Reproduce
- Install
npm install gatsby-source-graphql
- Configure
plugins
ingatsby.node.js
to usegatsby-source-graphql
- Run
npm run develop
and the error appears on the console
Expected Result
No error to show up.
Actual Result
An error is shown on running npm run develop
.
Environment
System:
OS: macOS 12.0.1
CPU: (10) arm64 Apple M1 Pro
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.0/bin/npm
Languages:
Python: 2.7.18 - /usr/bin/python
Browsers:
Chrome: 95.0.4638.69
Edge: 95.0.1020.53
Safari: 15.1
npmPackages:
gatsby: ^4 => 4.2.0
gatsby-source-graphql: ^4.2.0 => 4.2.0
npmGlobalPackages:
gatsby: 4.2.0
Config Flags
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:18 (3 by maintainers)
Apple silicon m1 with:
having the same issue when running
npm start
on gatsby that I initiated today with gatsby initError: Package subpath './public/extractFiles' is not defined by "exports" in /myMachineFolders/node_modules/apoll o-upload-client/node_modules/extract-files/package.json
nvm use v16.13.1 resolves this issue locally, but when trying to deploy on vercel this weird issue pops-up:
error Error in "/vercel/path0/node_modules/gatsby-source-graphql/gatsby-node.js": Cannot find module '/vercel/path0/node_modules/extract-files/public/extractFiles'
@LekoArts the warning only shows up with the latest npm and node version. I was able to reproduce it with the versions provided by @joselcvarela. I am creating a PR updating the dependency.