Closed lrstanley closed 2 years ago
I ran into the same bug and after a bit of digging, I found the cause. The problem is that when a new CodegenContext
is created at src/index.ts:115
, neither filepath
nor graphqlConfig
is passed to its constructor which results in filepath
being set to undefined
. Later on, the normalize
function is called with CodegenContext
's filepath
whose value is undefined
, but the function expects a string, therefore it throws an error. My temporary solution was to patch src/index.ts:115
locally:
- codegenContext = new import_cli.CodegenContext({ config });
+ codegenContext = new import_cli.CodegenContext({ config, filepath: '' });
This is obviously not the most elegant way of "fixing" it, but it works for the time being. Hope this helps!
Ah, good catch! This looks like a relatively simple fix. I will hopefully be able to get a release out for this soon!
Alright, should be fixed now! Feel free to reopen this issue or create another one if the problem persists after updating.
Thanks for letting me know about this and helping to track down the issue!
Works great, thanks!
I have the following
vite.config.ts
file (converting from a codegen.yaml file):When starting vite, I run into the following error
Disabling
enableWatcher
works without issue, so I suspect it's related to the file glob references forschema
anddocuments
with the file watcher specifically. I know the docs mention only file paths, but curious if globs aren't supported either (even though they are standard local files)?Version Info