question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecated dependencies on `gatsby-source-graphql`

See original GitHub issue

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

  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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
pozdacommented, 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'

3reactions
pranav0281999commented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from v3 to v4 - Gatsby
After upgrading, run gatsby build and look for deprecation messages in the build log. ... Next, you need to update your dependencies to...
Read more >
NPM warn message about deprecated package - Stack Overflow
An interactive menu shows all required information about dependencies in the current folder and allows to update all dependencies in 3 ...
Read more >
Would deprecated dependencies cause issues? - MongoDB
When running npm install, there are warnings about deprecated dependencies that look like this tutorial is using some very old version.
Read more >
gatsby plugin extract-files package #13068 - Issuehunt
error: `(node:7498) [DEP0148] DeprecationWarning: Use of deprecated folder ... extract-files seems to be a nested dependency of gatsby-source-directus :
Read more >
Using deprecated packages - npm Docs
A deprecation message doesn't always mean the package or version is unusable; it may mean the package is unmaintained and will no longer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found