-
-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
The supabase gen types typescript
command generates TypeScript types with inconsistent field ordering, causing git diff failures in CI pipelines. The same database schema produces different field orders across different runs, making it impossible to maintain consistent type definitions in version control.
To Reproduce
Steps to reproduce the behavior:
- Set up a GitHub Actions workflow with the following configuration:
jobs:
test-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: 2.26.9
- name: Start Supabase local development setup
run: supabase db start
- name: Verify generated types are checked in
run: |
supabase gen types typescript --local > types/schema.gen.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet types/schema.gen.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
- Run the workflow multiple times
- Observe that the generated types have different field orders each time
- See the diff failure in CI
--- a/types/schema.gen.ts
+++ b/types/schema.gen.ts
@@ -17,10 +17,10 @@ export type Database = {
Functions: {
graphql: {
Args: {
- extensions?: Json
- operationName?: string
query?: string
+ operationName?: string
variables?: Json
+ extensions?: Json
}
Returns: Json
}
Error: Process completed with exit code 1.
thespacemanatee, david-tso-rz, felixgabler, mateuszbasiak, salmoro and 1 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working