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

Yarn 3 dev commands fails with missing deps #35140

Closed
2 tasks done
graysonhicks opened this issue Mar 15, 2022 · 4 comments · Fixed by #35194
Closed
2 tasks done

Yarn 3 dev commands fails with missing deps #35140

graysonhicks opened this issue Mar 15, 2022 · 4 comments · Fixed by #35194
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@graysonhicks
Copy link
Contributor

Preliminary Checks

Description

When starting a Gatsby project with Yarn 3, the install works correctly, but when trying to run gatsby develop you get the following error:

Error: Your application tried to access gatsby-parcel-config, but it isn’t declared in your dependencies; this makes the require call ambiguous and unsound.

This leads to this section of the Yarn docs. Which recommends:

Or the code has to be modified in order to use the paths option from require.resolve: require(require.resolve(jest-environment-${config.environment}, {paths:[config.projectPath]})) (note that this is the recommended option, being unintrusive for users and a good idea in general)

But this line seems to be already using paths in resolve correctly.

if you manually yarn add gatsby-parcel-config --dev the error goes away but then it just throws the same for the next gatsby dep (dontev), which doesn’t seem right.

Reproduction Link

https://github.com/graysonhicks/gatsby-yarn3-deps-bug

Steps to Reproduce

  1. git clone git@github.com:graysonhicks/gatsby-yarn3-deps-bug.git
  2. cd gatsby-yarn3-deps-bug
  3. nvm use
  4. yarn
  5. yarn start

Expected Result

Local up and running.

Actual Result

There was an unhandled error during compilation for
/Users/graysonhicks/Documents/Development/yarn3-test. Please run the command with the --verbose flag
 again.



  Error: Your application tried to access gatsby-parcel-config, but it isn't declared in your depend
  encies; this makes the require call ambiguous and unsound.
  Required package: gatsby-parcel-config
  Required by: /Users/graysonhicks/Documents/Development/yarn3-test/
  Require stack:
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/utils/parcel/compile-gatsby-files.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/bootstrap/get-config-file.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/bootstrap/load-config/index.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/services/initialize.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/services/index.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/state-machines/develop/services.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/state-machines/develop/index.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.yarn/unplugged/gatsby-virtual-55bb897422/n
  ode_modules/gatsby/dist/commands/develop-process.js
  - /Users/graysonhicks/Documents/Development/yarn3-test/.cache/tmp-54011-e7J7NL2RgeY5

  - .pnp.cjs:28270 Function.require$$0.Module._resolveFilename
    /Users/graysonhicks/Documents/Development/yarn3-test/.pnp.cjs:28270:13

  - helpers:108 Function.resolve
    node:internal/modules/cjs/helpers:108:19

  - compile-gatsby-files.ts:20 constructParcel
    [gatsby-virtual-55bb897422]/[gatsby]/src/utils/parcel/compile-gatsby-files.ts:20:28

  - compile-gatsby-files.ts:45 compileGatsbyFiles
    [gatsby-virtual-55bb897422]/[gatsby]/src/utils/parcel/compile-gatsby-files.ts:45:20

  - initialize.ts:171 initialize
    [gatsby-virtual-55bb897422]/[gatsby]/src/services/initialize.ts:171:9

  - interpreter.js:859 Interpreter.exec
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/interpreter.js:859:61

  - interpreter.js:205 Interpreter.execute
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/interpreter.js:205:14

  - interpreter.js:231 Interpreter.update
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/interpreter.js:231:12

  - interpreter.js:480
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/interpreter.js:480:13

  - scheduler.js:69 Scheduler.process
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/scheduler.js:69:7

  - scheduler.js:32 Scheduler.initialize
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/scheduler.js:32:12

  - interpreter.js:479 Interpreter.start
    [xstate-npm-4.30.6-e139413d54-ee34698cbd.zip]/[xstate]/lib/interpreter.js:479:20

  - develop-process.ts:162 module.exports
    [gatsby-virtual-55bb897422]/[gatsby]/src/commands/develop-process.ts:162:11

  - task_queues:96 processTicksAndRejections
    node:internal/process/task_queues:96:5


not finished compile gatsby files - 0.060s

Environment

System:
    OS: macOS 11.2.3
    CPU: (8) arm64 Apple M1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 3.2.0 - ~/.nvm/versions/node/v16.13.1/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 99.0.4844.51
    Safari: 14.0.3

Config Flags

N/A

@graysonhicks graysonhicks added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 15, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 15, 2022
@marvinjude marvinjude added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 16, 2022
@marvinjude
Copy link
Contributor

Hey @graysonhicks!

Seem like the same reason why our PnP tests are currently failing. We'll looks into this.

Thanks!

@hellow554

This comment was marked as outdated.

@pieh
Copy link
Contributor

pieh commented Mar 22, 2022

We released @next with fixes (gatsby@4.11.0-next.4). Will be relasing same fix to @latest today

@graysonhicks
Copy link
Contributor Author

Confirmed this fixes the site I was building by using the latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants