Skip to content
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

TypeError: a.argument.name.localeCompare is not a function #228

Open
jgeudens opened this issue Jan 3, 2025 · 0 comments
Open

TypeError: a.argument.name.localeCompare is not a function #228

jgeudens opened this issue Jan 3, 2025 · 0 comments

Comments

@jgeudens
Copy link

jgeudens commented Jan 3, 2025

Versions used

  • Node.js v22.11.0
  • "kysely-codegen": "^0.17.0",
  • "better-sqlite3": "^11.7.0",
  • "kysely": "^0.27.5"

Data

Debug info

kysely-codegen --log-level debug --print --include-pattern="c*"

• Loaded environment variables from '.env'.
• No dialect specified. Assuming 'sqlite'.
• Introspecting database...

Found 6 public tables:

  • chassis
  • circuit
  • constructor
  • constructor_chronology
  • continent
  • country

/home/projects/node_modules/kysely-codegen/dist/generator/transformer/transform.js:285
tableNodes.sort((a, b) => a.argument.name.localeCompare(b.argument.name));
^

TypeError: a.argument.name.localeCompare is not a function
at /home/projects/node_modules/kysely-codegen/dist/generator/transformer/transform.js:285:47
at Array.sort ()
at transformTables (/home/projects/node_modules/kysely-codegen/dist/generator/transformer/transform.js:285:16)
at transform (/home/projects/node_modules/kysely-codegen/dist/generator/transformer/transform.js:300:24)
at generate (/home/projects/node_modules/kysely-codegen/dist/generator/generator/generate.js:28:45)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Cli.generate (/home/projects/node_modules/kysely-codegen/dist/cli/cli.js:71:9)
at async Cli.run (/home/projects/node_modules/kysely-codegen/dist/cli/cli.js:168:13)

Node.js v22.11.0

Extra information

When trying to generate types for the complete database, I also get the following error. I narrowed it down to the tables starting with a "c".

I have tried to generate all tables separately and this seems to work correctly. Only this specific combination fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant