Skip to content
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

Deprecated dependencies on gatsby-source-graphql #34042

Closed
2 tasks done
joselcvarela opened this issue Nov 22, 2021 · 19 comments · Fixed by #34772
Closed
2 tasks done

Deprecated dependencies on gatsby-source-graphql #34042

joselcvarela opened this issue Nov 22, 2021 · 19 comments · Fixed by #34772
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@joselcvarela
Copy link

Preliminary Checks

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. ​jaydenseric/extract-files#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

  1. Install npm install gatsby-source-graphql
  2. Configure plugins in gatsby.node.js to use gatsby-source-graphql
  3. 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

@joselcvarela joselcvarela added the type: bug An issue or pull request relating to a bug in Gatsby label Nov 22, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 22, 2021
@LekoArts LekoArts added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Nov 22, 2021
@LekoArts
Copy link
Contributor

Hi!

Since I couldn't use your reproduction as I don't have any directus running I was simply adding the plugin to the config and used the SWAPI endpoint from the README. I don't get any errors during gatsby develop or gatsby build. Please post a minimal reproduction which shows this. Thanks!

@laurenzcodes
Copy link

laurenzcodes commented Nov 23, 2021

I am also getting this warning. It's related to the @graphql-tools/links package being outdated (the newer (v8.2.1) one uses a more recent version of extract-files (11.0.0) which might fix the bug.

They are changing the problematic mapping in this commit and also have an issue addressing the problem here

@joselcvarela
Copy link
Author

Hello @LekoArts
Sorry for not giving a proper reproduction. As you mentioned, I have updated to use the Swapi url, but I still have the issue:

image

@LekoArts LekoArts added good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby labels Nov 24, 2021
@LekoArts
Copy link
Contributor

I'm still not seeing this on my end, but this might not be the normal behavior for others then. It's a warning and things will still work, so I'm not considering this a bug. Feel free to put up a PR updating the required dependencies to get rid of this warning.

@pranav0281999
Copy link

pranav0281999 commented Nov 24, 2021

@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.

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Dec 15, 2021
@pozda
Copy link

pozda commented Dec 19, 2021

Apple silicon m1 with:

  • node v17.0.1 and npm v8.1.0
  • gatsby v4.4.0
  • gatsby-source-graphql v4.4.0

having the same issue when running npm start on gatsby that I initiated today with gatsby init

Error: 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'

@github-actions github-actions bot removed the stale? Issue that may be closed soon due to the original author not responding any more. label Dec 19, 2021
@github-actions
Copy link

github-actions bot commented Jan 8, 2022

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jan 8, 2022
@vinayakweb-prog

This comment has been minimized.

@github-actions github-actions bot removed the stale? Issue that may be closed soon due to the original author not responding any more. label Jan 9, 2022
@karunakaran186

This comment has been minimized.

@carolinmaisenbacher
Copy link

carolinmaisenbacher commented Jan 13, 2022

I ran into the same error and downgrading to node@16 worked.

My setup before:
Apple silicon m1
node v17.2.1 and npm v8.1.2
gatsby v4.4.0
gatsby-source-graphql v4.2.0

Now, I downgraded to v16.13.2

@presto2116
Copy link

I am still getting this error locally and on netlify and gatsby cloud. downgrading to v16.13.2 didn't help since we have been on node v16.13.0.
I attempted downgrading from gatsby-source-graphql v4.4.0 => v4.2.0
I also attempted upgrading to v4.5.2

Neither removed the error in the build logs

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 12, 2022
@anyav77
Copy link

anyav77 commented Feb 12, 2022

I don't know if it's related, but I'm getting an error on pulling images from 8base:
<img src={article.cover_thumbnail.shareUrl + "?download=true"} />

Tested on Gatsby 2 and 4

@AshuuDixit
Copy link

Steps to Reproduce

Install npm install gatsby-source-graphql
Configure plugins in gatsby.node.js to use gatsby-source-graphql
Run npm run develop and the error appears on the console

@github-actions github-actions bot removed the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 12, 2022
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 4, 2022
@LekoArts LekoArts added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Mar 14, 2022
@LekoArts
Copy link
Contributor

Please try out gatsby-source-graphql@4.11.0-next.1 and report back. Thanks!

@pascal-lauener-livinguard

gatsby-source-graphql@4.11.0-next.1 is solving the issue for me

@hood
Copy link

hood commented Jun 23, 2024

can this get backported for v3 too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet