remix-fundamentals icon indicating copy to clipboard operation
remix-fundamentals copied to clipboard

macOS Error: Exercise directory .DS_Store does not match regex /^(?<number>\d+)-/

Open tiagocouto126 opened this issue 2 years ago • 4 comments

It seems that on macOS this might be a problem when running npm run dev or node dev in the root:

throw new Error(`Exercise directory ${dir} does not match regex ${regex}`);
          ^

Error: Exercise directory .DS_Store does not match regex /^(?<number>\d+)-/
    at null.extractExerciseNumber (/remix-fundamentals-main/scripts/utils/utils.ts:102:11)
    at null.getAppFromPath (/remix-fundamentals-main/scripts/utils/utils.ts:115:36)
    at Array.map (<anonymous>)
    at null.<anonymous> (/remix-fundamentals-main/scripts/utils/utils.ts:113:16)
    at async Promise.all (index 0)
    at null.getApps (/remix-fundamentals-main/scripts/utils/utils.ts:109:50)
    at null.promptForApp (/remix-fundamentals-main/scripts/utils/utils.ts:248:16)
    at null.go (/remix-fundamentals-main/scripts/dev/dev.ts:13:11)
  1. I've removed part of the path name for ease of read
  2. no error if npm run dev on an exercise directory (since there is no .DS_Store)
  3. I know I can remove this files (even disable) and it will skip this error, until the file is created again, so maybe a filter for directories/name pattern would help here: scripts/utils.ts

tiagocouto126 avatar Oct 07 '22 10:10 tiagocouto126

had the same issue, for anybody that comes here in the future, as stated above, you can remove the file. in the application root run

rm exercise/.DS_Store

brianseries avatar Nov 06 '22 03:11 brianseries

I'm having this same issue... I've tried different versions of node, but still get the same error mentioned above when running npm run setup.

I don't see the file /exercises/.DS_Store, so nothing to remove there.

throw new Error(`Exercise directory ${dir} does not match regex ${regex}`);
      ^

Error: Exercise directory .DS_Store does not match regex /^(?<number>\d+)-/
    at extractExerciseNumber (/remix-fundamentals/scripts/utils/utils.ts:102:11)
    at getAppFromPath (/remix-fundamentals/scripts/utils/utils.ts:151:36)
    at Array.map (<anonymous>)
    at <anonymous> (/remix-fundamentals/scripts/utils/utils.ts:149:16)
    at async Promise.all (index 1)
    at getApps (/remix-fundamentals/scripts/utils/utils.ts:109:50)
    at runInDirs (/remix-fundamentals/scripts/utils/utils.ts:269:13)

mlaurel avatar Nov 13 '22 21:11 mlaurel

I'm having this same issue... I've tried different versions of node, but still get the same error mentioned above when running npm run setup.

I don't see the file /exercises/.DS_Store, so nothing to remove there.

throw new Error(`Exercise directory ${dir} does not match regex ${regex}`);
      ^

Error: Exercise directory .DS_Store does not match regex /^(?<number>\d+)-/
    at extractExerciseNumber (/remix-fundamentals/scripts/utils/utils.ts:102:11)
    at getAppFromPath (/remix-fundamentals/scripts/utils/utils.ts:151:36)
    at Array.map (<anonymous>)
    at <anonymous> (/remix-fundamentals/scripts/utils/utils.ts:149:16)
    at async Promise.all (index 1)
    at getApps (/remix-fundamentals/scripts/utils/utils.ts:109:50)
    at runInDirs (/remix-fundamentals/scripts/utils/utils.ts:269:13)

Do you have the hidden files visible? Use "CMD + shift + ." to toggle it.

You can delete that file or change in the utility ts file to filter and exclude so it can prevent that error. I've changed to filter the directory before the iteration.

tiagocouto126 avatar Nov 13 '22 21:11 tiagocouto126

I'm showing hidden files... the file isn't there.

FWIW, I ended up finding an old remix-fundamental repo from a few weeks ago and pulled latest. Ran npm run setup and it went through the whole setup script and node dev worked this time!

My TS knowledge is so weak, I don' think I'm going to try and figure out what went wrong... just picking back up with Remix. Thanks for the help regardless.

mlaurel avatar Nov 13 '22 21:11 mlaurel