Skip to content

Commit

Permalink
fix(client): fix runtime.prettyName (#23446)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Mar 11, 2024
1 parent 272bc3d commit 3b45747
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Expand Up @@ -338,7 +338,7 @@ class PrismaClient {
- Use Driver Adapters: https://pris.ly/d/driver-adapters
\`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime + '\`).'
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
}

message += \`
Expand Down
Expand Up @@ -338,7 +338,7 @@ class PrismaClient {
- Use Driver Adapters: https://pris.ly/d/driver-adapters
\`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime + '\`).'
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
}

message += \`
Expand Down
Expand Up @@ -359,7 +359,7 @@ class PrismaClient {
- Use Driver Adapters: https://pris.ly/d/driver-adapters
\`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime + '\`).'
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
}

message += \`
Expand Down
Expand Up @@ -359,7 +359,7 @@ class PrismaClient {
- Use Driver Adapters: https://pris.ly/d/driver-adapters
\`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime + '\`).'
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
}

message += \`
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/generation/TSClient/TSClient.ts
Expand Up @@ -371,7 +371,7 @@ class PrismaClient {
- Use Driver Adapters: https://pris.ly/d/driver-adapters
\`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime + '\`).'
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
}
message += \`
Expand Down
Expand Up @@ -2,7 +2,7 @@ test('proper error is shown when the client is bundled into a frontend', async (
const message = await require('../dist/new-client.js').call()

expect(message).toMatchInlineSnapshot(`
"PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`node\`).
"PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`Node.js\`).
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report"
`)
})
Expand Down

0 comments on commit 3b45747

Please sign in to comment.