Migration error "TypeError: Cannot read properties of undefined (reading 'getExecutor')"
I am trying to run a migration using Kysely, and its returning this error:
Does anybody have an idea of how to fix this? I can't find any reference to it
I couldn't post the content of my
migrate-to-latest.js
and my migration files, because of char limit.12 Replies
Update: I changed my code slightly and am getting a different error.
after adding
db
:
But I'm still getting an error:
`You have two (or more) incompatible versions of Kysely and you are mixing parts of them.
How so? I haven't installed Kysely, it was automatically installed from SST. How can I fix it?
I don't know how to fix it. I haven't used SST. But this error keeps popping up and the reason is always the same.
In your example
db
probably comes from a different Kysely package than the sql
template tag.this is my full example:
am I using the wrong package?
and this is my
migrate-to-latest.js
file:
How should I know that? I don't know where
db
comes and where kysely
points. It depends on your configuration.
To make sure we are dealing with two different versions, add this at the top of the script
and add this to the script
if it prints true
I'm wrong, if false
db
doesn't come from the imported kysely.It prints false
Actually you can also do
db instanceof Kysely
Yep. So somehow somewhere, there's two versions. The kysely you import in the script is not the same that was used to create db
.
Modern versions of kysely should already be able to deal with most of these mixed versions issues. You could start by updating the SST packagesThank you for your help so far. Maybe installing kysely package directly can help. I'll report back what I find.
Switching to
pnpm
and enforcing a kysely version at package.json
might fix itpackage.json | pnpm
The manifest file of a package. It contains all the package's metadata,
pnpm hoists packages and dries up your node_modules by default, so there would be just 1 copy of kysely once you force kysely v0.24.2, 🤞🏻