Skip to content

[Bug] docz fails to run when upgrading to yarn@berry #1024

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

Closed
1 task done
dannyrb opened this issue Mar 2, 2020 · 2 comments
Closed
1 task done

[Bug] docz fails to run when upgrading to yarn@berry #1024

dannyrb opened this issue Mar 2, 2020 · 2 comments
Labels
bug Something isn't working stale Issues that didn't get attention

Comments

@dannyrb
Copy link

dannyrb commented Mar 2, 2020

  • I'd be willing to implement a fix

Describe the bug

I have a monorepo. A project in our monorepo uses docz for its component library. [email protected] uses gatsby under the hood. When running yarn run dev, which executes the boilerplate npm script docz dev, I receive an error that I do not receive when using yarn 1.22.x

Building app
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn /home/dannyrb/code/Viewers/platform/ui/node_modules/.bin/gatsby ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

To get the command to run at all, I've had to modify my .yarnrc.yml:

packageExtensions:
  docz-core@*:
    dependencies:
      cross-spawn: '*'
      tslib: '*'
      opn: '*'
  react-docgen-typescript@*:
    dependencies:
      typescript: '*'

To Reproduce

The minimal information needed to reproduce your issue (ideally a package.json with a single dep). Note that bugs without minimal reproductions might be closed.

I will circle back to add a reproduction; I wanted to get this issue up before I packed up for the day.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment if relevant (please complete the following information):

  • OS: Ubuntu@19
  • Node version: 10.19
  • Yarn version: 2.0.0-rc.29

Additional context

docz does this odd thing where the project contains a .docz directory that contains an autogenerated gatsby project (with webpack config and package.json). This project is where the webpack process is started. I'm unsure of if this extra nesting causes issues.

I have included the gatsby-node.js PnpWebpackPlugin snippet.

@dannyrb dannyrb added the bug Something isn't working label Mar 2, 2020
@dannyrb dannyrb changed the title [Bug] [Bug] docz fails to run when upgrading to yarn@berry Mar 2, 2020
@dannyrb
Copy link
Author

dannyrb commented Mar 2, 2020

I was able to get some debug hints from running docz build. It called out that my binary was trying to access dependencies that weren't specified. Which reminded me of this:

#9

Adding these to dependencies:

  • lodash
  • core-js

And these to devDependencies:

  • fs-extra

Appear to have moved me closer to what I want, but the config is now unable to resolve the gatsby-theme-docz:

npm WARN lifecycle The node binary used for scripts is /tmp/tmp-17846NC3MwdeViYgb/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> docz-app@ build /home/dannyrb/code/Viewers/platform/ui/.docz
> gatsby build "--prefixPaths" "/"


 ERROR #10226  CONFIG

Couldn't find the "gatsby-theme-docz" plugin declared in "/home/dannyrb/code/Viewers/platform/ui/.docz/gatsby-config.js".

Tried looking for a local plugin in /home/dannyrb/code/Viewers/platform/ui/.docz/plugins/gatsby-theme-docz.

Tried looking for an installed package in the following paths:
 - /home/dannyrb/code/Viewers/.yarn/unplugged/gatsby-virtual-c3f5930f7a/node_modules/gatsby/dist/bootstrap/load-themes/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/.yarn/unplugged/gatsby-virtual-c3f5930f7a/node_modules/gatsby/dist/bootstrap/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/.yarn/unplugged/gatsby-virtual-c3f5930f7a/node_modules/gatsby/dist/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/.yarn/unplugged/gatsby-virtual-c3f5930f7a/node_modules/gatsby/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/.yarn/unplugged/gatsby-virtual-c3f5930f7a/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/.yarn/unplugged/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/.yarn/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/Viewers/node_modules/gatsby-theme-docz
 - /home/dannyrb/code/node_modules/gatsby-theme-docz
 - /home/dannyrb/node_modules/gatsby-theme-docz
 - /home/node_modules/gatsby-theme-docz
 - /node_modules/gatsby-theme-docz

@yarnbot
Copy link
Collaborator

yarnbot commented Jun 9, 2020

Hi! 👋

This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolution faster). It helps us help you! 😃

If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label.

@yarnbot yarnbot added the stale Issues that didn't get attention label Jun 9, 2020
@yarnbot yarnbot closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that didn't get attention
Projects
None yet
Development

No branches or pull requests

2 participants