[ERR_UNKNOWN_FILE_EXTENSION] when running migrations
I have a project with Sveltekit, TypeScript, and Kysely with SQLite. When I run my migrations, using the FileMigrationProvider, I get the following error:
What am I doing wrong?
Solution:Jump to solution
I got it working by avoiding FileMigrationProvider. Kind of hacky, not sure if there's a better way to do these imports:
https://github.com/crummy/finances/commit/3b4ff5ce86a7767baa8ef3da2f279bbfc71d1ae0...
14 Replies
I had the same problem, there is a thread about it in the discord
Are you on windows?
ok windows? Not sure what you mean
On windows?
No, on a Mac.
Not my same problem then
Mine was because of how Esm module resolution works on windows
I think I've got the same problem as https://github.com/Terbau/kysely-sveltekit-migration-error-recreation
GitHub
GitHub - Terbau/kysely-sveltekit-migration-error-recreation: Recrea...
Recreation of error. Contribute to Terbau/kysely-sveltekit-migration-error-recreation development by creating an account on GitHub.
Is your code the same as in that repo?
If not could you share yours?
Mine's here: https://github.com/crummy/finances
GitHub
GitHub - crummy/finances: Simple app to query transactions from an ...
Simple app to query transactions from an Akahu API - GitHub - crummy/finances: Simple app to query transactions from an Akahu API
google seems to indicate I should remove
type: "module"
from package.json, but SvelteKit seems to return a bunch of errors when I do thatSolution
I got it working by avoiding FileMigrationProvider. Kind of hacky, not sure if there's a better way to do these imports:
https://github.com/crummy/finances/commit/3b4ff5ce86a7767baa8ef3da2f279bbfc71d1ae0
That's no hacky at all. The reason we have the
MigrationProvider
abstraction is basically that you can do exactly that.Yeah.... Just felt a bit hacky to add the migrations in one place (the files) and then in another place (pointing the migration provider to them)
Well that's what you have to do with some of these bundlers. You can't have dynamic imports
Makes sense