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

blitz start broken in 0.8.0-canary.4 #484

Closed
flybayer opened this issue May 1, 2020 · 9 comments · Fixed by blitz-js/blitz#389
Closed

blitz start broken in 0.8.0-canary.4 #484

flybayer opened this issue May 1, 2020 · 9 comments · Fixed by blitz-js/blitz#389

Comments

@flybayer
Copy link
Member

flybayer commented May 1, 2020

What is the problem?

Steps to Reproduce:

  1. yarn global add blitz@0.8.0-canary.4
  2. blitz new myapp
  3. cd myapp
  4. blitz start
  5. Fails with
/t/a1> blitz s
You are using alpha software - if you have any problems, please open an issue here:
  https://github.com/blitz-js/blitz/issues/new/choose

◢ Preparing for launchError: File not found with singular glob: /private/tmp/a1/node_modules/npm-normalize-package-bin//bin/ (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (/private/tmp/a1/node_modules/glob-stream/readable.js:84:17)
    at Object.onceWrapper (events.js:417:26)
    at Glob.emit (events.js:310:20)
    at Glob.EventEmitter.emit (domain.js:482:12)
    at Glob._finish (/private/tmp/a1/node_modules/glob/glob.js:197:8)
    at done (/private/tmp/a1/node_modules/glob/glob.js:182:14)
    at Glob._processSimple2 (/private/tmp/a1/node_modules/glob/glob.js:688:12)
    at /private/tmp/a1/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/private/tmp/a1/node_modules/glob/glob.js:772:12)
    at lstatcb_ (/private/tmp/a1/node_modules/glob/glob.js:764:12)

Maybe this is related to changes in blitz-js/blitz#365?

Weird workaround

  1. rm -rf node_modules
  2. yarn
  3. blitz start -> works

cc @ryardley @Skn0tt

@flybayer
Copy link
Member Author

flybayer commented May 1, 2020

@Skn0tt it seems the gitignore check is crawling the file system to and compiling a list of all ignored files. Is that what it's doing?

@Skn0tt
Copy link
Member

Skn0tt commented May 1, 2020

Yup. Didn't know about the allowEmpty option 🙈 I'm gonna provide a PR real quick

@Skn0tt
Copy link
Member

Skn0tt commented May 1, 2020

As can be seen from the stack trace, allowEmpty is an option on glob-stream, which is a dependency two layers below fast-glob. Let's see how we can interface with that 🧐

@Skn0tt
Copy link
Member

Skn0tt commented May 1, 2020

After some investigation, it seems like glob-stream is just a devDependency to fast-glob. The real reason we've got glob-stream is vinyl-fs:

$ yarn why glob-stream
=> Found "glob-stream@6.1.0"
info Reasons this module exists
   - "_project_#@blitzjs#server#vinyl-fs" depends on it
   - Hoisted from "_project_#@blitzjs#server#vinyl-fs#glob-stream"

@Skn0tt
Copy link
Member

Skn0tt commented May 1, 2020

Found the root-cause, it is indeed related to blitz-js/blitz#365: Gitignore entries starting with a / make it stumble. Weird, I thought I'd tested for that.

@flybayer
Copy link
Member Author

flybayer commented May 1, 2020

Ok cool.

Is there a way can do this without actually reading all the gitignore files? Because it causes a performance hit on boot up

@Skn0tt
Copy link
Member

Skn0tt commented May 1, 2020

Nope, don't think so. blitz-js/blitz#389 excludes node_modules from the glob search though, which should make the performance hit neglegible.

@Skn0tt
Copy link
Member

Skn0tt commented May 1, 2020

It'd be possible to further speed it up by doing an informed glob search based on already-found .gitignores, but I'd rather not add that complexity that until the performance hit is noticeable.

@flybayer
Copy link
Member Author

flybayer commented May 1, 2020

Ok, perfect. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants