-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix type gen bug #449
Fix type gen bug #449
Conversation
setError(() => undefined); | ||
} catch (error) { | ||
handleCodeGenError(error); | ||
setTypesGenerationError(() => undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setTypesGenerationError(() => undefined); | |
setTypesGenerationError(undefined); |
Using a function is only necessary when you intend to use the existing state, i.e. (currentState) => currentState + 1
async function handleFormating() { | ||
await reformat(indexingCode, schema); | ||
await reformatAll(indexingCode, schema); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await reformatAll(indexingCode, schema); | |
reformatAll(indexingCode, schema); |
This function is not async
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I tried to run the frontend locally again, since it's been a while. But, it wasn't loading for some reason. I did:
- yarn serve:widgets:local
- Set flag to http://127.0.0.1:3030
- Ran yarn dev in a separate terminal
- Visited localhost:3000.
I was stuck at the loading screen.
handleCodeGenError(error); | ||
setTypesGenerationError(() => undefined); | ||
} catch (typesError) { | ||
console.log("typesGenerationError generating types for saved schema.\n", typesError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a console.error? Same for the others.
We have an issue where if the formatting of SQL is not current or we encounter a case in which we do not support the type generation library for the context method, we fail very abruptly.
This PR handles these errors better.