Blitz: error: File not found with singular glob

Created on 5 Nov 2020  Â·  13Comments  Â·  Source: blitz-js/blitz

What is the problem?

When trying to start an brand new project I get the following error

Preparing for launch[Error: File not found with singular glob: /Users/talbet/Experiments/btest/TAGS/ (if this was purposeful, use `allowEmpty` option)]

Could be related to #388 but TAGS makes me think it is unrelated.

Steps to Reproduce

  1. run blitz new btest (have also tried with --npm and --no-git)
  2. run initial migration inside btest directory
  3. run blitz start

Versions

macOS Mojave | darwin-x64 | Node: v14.15.0

blitz: 0.24.3 (global)
blitz: 0.24.3 (local)

  Package manager: npm
  System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
    Memory: 673.28 MB / 16.00 GB
    Shell: 5.7.1 - /usr/local/bin/zsh
  Binaries:
    Node: 14.15.0 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  npmPackages:
    @prisma/cli: 2.10.2 => 2.10.2
    @prisma/client: 2.10.2 => 2.10.2
    blitz: 0.24.3 => 0.24.3
    react: 0.0.0-experimental-7f28234f8 => 0.0.0-experimental-7f28234f8
    react-dom: 0.0.0-experimental-7f28234f8 => 0.0.0-experimental-7f28234f8
    typescript: 4.0.5 => 4.0.5

Other

I have tried to create an empty TAGS directory to see if that helps, but I still get the error.

kinbug statudone

All 13 comments

Hmm, I'm unable to reproduce.

What version of git do you have installed?

git version 2.28.0

Ok, that's same as mine. Could you try with a different node version, like maybe 12.19.0?

Installed node 12.19.0 and reinstalled, but got the same result.

I did notice that the SQLite database is not being initialized, is this expected behavior for a new project?

✔ Retrieving the freshest of dependencies
✔ Installing those dependencies (this will take a few minutes)
✔ Formatting your code
✔ Committing your app
✖ Initializing SQLite database

Sqlite should be initialized too.

It seems like this is maybe specific to your environment somehow, but I'll go ahead and mark as a bug in case anyone else comes across it

No worries, I'll take a look at why sqlite isn't initializing.

I have a similar problem, and no trouble with sqlite.

Preparing for launchError: File not found with singular glob: /Users/davidmazza/Sites/ppm/default.xcworkspace (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (/Users/davidmazza/Sites/ppm/node_modules/glob-stream/readable.js:84:17)
    at Object.onceWrapper (node:events:434:26)
    at Glob.emit (node:events:327:20)
    at Glob._finish (/Users/davidmazza/Sites/ppm/node_modules/glob/glob.js:197:8)
    at done (/Users/davidmazza/Sites/ppm/node_modules/glob/glob.js:182:14)
    at Glob._processSimple2 (/Users/davidmazza/Sites/ppm/node_modules/glob/glob.js:688:12)
    at /Users/davidmazza/Sites/ppm/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/Users/davidmazza/Sites/ppm/node_modules/glob/glob.js:772:12)
    at lstatcb_ (/Users/davidmazza/Sites/ppm/node_modules/glob/glob.js:764:12)
    at RES (/Users/davidmazza/Sites/ppm/node_modules/inflight/inflight.js:31:16)

I should note that I'm an iOS developer, and I have !default.xcworkspace un-ignored in other .gitignore files from other project folders withing my Sites/ directory.

This is a portion of the standard .gitignore file that I use for many iOS projects:

*.xcworkspace          # ignore all files with the extension .xcworkspace
!default.xcworkspace   # but don't ignore default.xcworkspace

Blitz must be scanning .gitignore files in projects that are unrelated to my Blitz project.

@flybayer seems to confirm that in #388:

Is there a way can do this without actually reading all the gitignore files?

Updated 11/12: I was wrong about this, see my newer comment below

Other details

blitz -v
You are using alpha software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

macOS Catalina | darwin-x64 | Node: v15.1.0

blitz: 0.25.0-canary.6 (global)
blitz: 0.25.0-canary.6 (local)

  Package manager: yarn 
  System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
    Memory: 2.22 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 15.1.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.0.8 - /usr/local/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/cli: 2.11.0 => 2.11.0 
    @prisma/client: 2.11.0 => 2.11.0 
    blitz: 0.25.0-canary.6 => 0.25.0-canary.6 
    react: 0.0.0-experimental-4ead6b530 => 0.0.0-experimental-4ead6b530 
    react-dom: 0.0.0-experimental-4ead6b530 => 0.0.0-experimental-4ead6b530 
    typescript: 4.0.5 => 4.0.5 

Upon closer inspection of the code and tests for packages/server/parse-chokidar-rules-from-gitignore.ts, I realized that I was partially wrong, and I found a way around this problem.

On parse-chokidar-rules-from-gitignore.ts:46 it looks for a global .gitignore file. I didn't remember creating one, but according to GitHub it lives in ~/.gitignore_global.

I opened my ~/.gitignore_global and found the offending line:

!default.xcworkspace   

I removed that line from my global gitignore and it solved that problem, but there were a few other similar lines that I needed to remove as well. Once I removed all the offending lines, I was able to run blitz start without a problem. This isn't an ideal workaround because I might want to keep those lines in my global gitignore for other projects, but nonetheless, I've identified the source of the problem for myself.

I was wrong in thinking that Blitz was reading my .gitignore from other projects, which also have those offending lines. But it is now clear that it is only reading my ~/.gitignore_global and the local .gitignore files within my blitz project.

Still, this is a kind of spooky-action-at-a-distance, and I think it should be fixed in Blitz.

While my sqlite problem is unresolved, @dmzza's comment prompted me to check my ~/.gitignore_global file and I can confirm that I have an ignore pattern TAGS. So it looks like my error was caused by the same thing. I agree that this is strange behavior, first that it throws an error due to the absence of an ignored file, and second, that it uses .gitignore_global.

I'm going to work on fixing this in Blitz.

@talbet-qga Would you mind pasting your whole ~/.gitignore_global here?

I made a PR that solves my problem with inclusion rules, but it isn't clear that you have any inclusion rules in your file.

No worries, it's a generic one that eagerly ignores file types I don't use, and haven't seen in some cases.

# MacOS
*.DS_Store
.Spotlight-V100
.Trashes

# Windows
Thumbs.db
Desktop.ini

# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
TAGS
!TAGS/
tags
!tags/
.tags
.tags1

# SASS
.sass-cache

# Webstorm
.idea

# VSCode
.vscode/*
wallaby.conf.js
.favorites.json

Thanks, this means you have the same problem as me, which is reassuring.

!TAGS/
!tags/

Those are inclusion rules, which just means it doesn't want git to ignore folders named TAGS or tags. The problematic code in Blitz expects to find those folders in your project, which wouldn't necessarily make sense even if this was the .gitignore file in your project, but certainly doesn't make sense from your global .gitignore.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SharadKumar picture SharadKumar  Â·  3Comments

MrLeebo picture MrLeebo  Â·  5Comments

netheril96 picture netheril96  Â·  4Comments

simonedelmann picture simonedelmann  Â·  3Comments

ryardley picture ryardley  Â·  5Comments