zvictor / brainyduck

🐥 A micro "no-backend" framework 🤯 Quickly build powerful BaaS using only your graphql schemas
https://duck.brainy.sh
GNU Affero General Public License v3.0
69 stars 3 forks source link

.cache config file generates erroneous file path string #31

Closed MataChuck closed 2 years ago

MataChuck commented 2 years ago
    ✘ [ERROR] Syntax error "d"
    .cache/tsconfig.json:2:21:
      2 │       "extends": "C:**\d**ev\brainyduck\examples\basic\node_modules\brainyduck\tsconfig.json", "include": ["C:\dev\brainyduck\examples\basic\node_modules\brainyduck\.cache\sdk.ts"], "compilerOptions...
        ╵

Hi Brainy Ducks, big fan of what you guys are doing, keep up the great work. Currently I'm getting some issues running the basic project which is the error found above. I'm running on Windows 11 in node versions 16 and 18. I believe that it's a string parsing issue with the backwards slash on Windows, because running the commands on Mac works fine. Any ideas or help for this is greatly appreciated. I feel like the issue would be solved if the generated .cache folder's tsconfig.json file location string added double backslashes for special characters.

zvictor commented 2 years ago

Thanks for the nice words, @MataChuck ! I haven't used Windows for over a decade by now, so I am sorry we don't have a good testing coverage in that OS.

Does the path C:**\d**ev\ even make any sense in Windows? Where is it actually trying to point to? Anyway, it looks like you are somehow getting a messed up value on the tsconfigFile variable somewhere in this part of the code:

https://github.com/zvictor/brainyduck/blob/0d42bc84ee6ef1d9daccfc27f944962e62897fa8/commands/build.js#L159-L177

There are a few things you should try:

  1. Rerun the commands following the debugging/testing instructions and then paste it here. Please make sure you add the full log to your next issue reports 😉
  2. Rerun the commands setting the env var BRAINYDUCK_TSCONFIG to point to something like ./node_modules/brainyduck/tsconfig.json (make sure it points to this file but in your local installation).
zvictor commented 2 years ago

Have you found a solution @MataChuck ? 😊