Tearing down MSSQL schema returns "Cannot read property 'split' of null"
See original GitHub issueBug description
Unable to migrate.
Environment variables loaded from prisma/.env
Prisma schema loaded from prisma/schema.prisma
Datasource "ms"
Error: Cannot read property 'split' of null
How to reproduce
Currently Prisma schema from introspecting an MSSQL database:
generator js {
provider = "prisma-client-js"
previewFeatures = ["microsoftSqlServer", "nativeTypes"]
}
datasource ms {
provider = "sqlserver"
url = env("DATABASE_URL")
}
model User {
id BigInt @id @default(autoincrement()) @ms.BigInt
name String? @ms.VarChar(255)
Post Post[]
}
model Post {
id BigInt @id @default(autoincrement()) @ms.BigInt
title String @ms.VarChar(100)
views BigInt @default(0) @ms.BigInt
wordCount Int @default(0) @ms.SmallInt
user_id BigInt @ms.BigInt
User User @relation(fields: [user_id], references: [id])
}
model Settings {
id Int @id @default(autoincrement())
title String
}
Since we don’t support native types yet, I adjusted it to this:
generator js {
provider = "prisma-client-js"
previewFeatures = ["microsoftSqlServer"]
}
datasource ms {
provider = "sqlserver"
url = env("DATABASE_URL")
}
// model User {
// id BigInt @id @default(autoincrement()) @ms.BigInt
// name String? @ms.VarChar(255)
// Post Post[]
// }
// model Post {
// id BigInt @id @default(autoincrement()) @ms.BigInt
// title String @ms.VarChar(100)
// views BigInt @default(0) @ms.BigInt
// wordCount Int @default(0) @ms.SmallInt
// user_id BigInt @ms.BigInt
// User User @relation(fields: [user_id], references: [id])
// }
// model Settings {
// id Int @id @default(autoincrement())
// title String
// }
Then ran:
npx prisma migrate dev --preview-feature
Resulting in:
Environment variables loaded from prisma/.env
Prisma schema loaded from prisma/schema.prisma
Datasource "ms"
Error: Cannot read property 'split' of null
Expected behavior
It should have cleared out my database.
Environment & setup
- OS:
- Database:
- Node.js version:
- Prisma version:
@prisma/cli : 2.13.0-dev.99
@prisma/client : 2.12.0-dev.55
Current platform : darwin
Query Engine : query-engine 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine : migration-engine-cli 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Studio : 0.329.0
Preview Features : microsoftSqlServer
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
TypeError: Cannot read Property 'split' of Null in JS | bobbyhadz
The "Cannot read property 'split' of null" error occurs when the split() method is called on a variable that stores a null value....
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >TypeError: Cannot read properties of null (reading 'split')
I have an angular application which is throwing me this error when I try to access it. TypeError: Cannot read properties of null...
Read more >cannot read properties of null (reading 'matches') npm - You.com
Cannot read property 'match' of undefined error handling ... The following function will return an array of the parameter names of any function...
Read more >SQL error messages and exceptions - Oracle Help Center
08004, User ' <authorizationID> ' cannot shut down database ... 22501, An ESCAPE clause of NULL returns undefined results and is not allowed....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just tested it again, also got
Looks like it was fixed, closing!
The native type gating works too well 😄, I can’t reproduce