Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
if (!resolvedBinaryTargets.includes(platform)) {
if (generator) {
console.log(`${chalk.yellow(
'Warning:',
)} Your current platform \`${chalk.bold(
platform,
)}\` is not included in your generator's \`binaryTargets\` configuration ${JSON.stringify(
generator.binaryTargets,
)}.
To fix it, use this generator config in your ${chalk.bold('schema.prisma')}:
${chalk.greenBright(
printGeneratorConfig({
...generator,
binaryTargets: fixPlatforms(generator.binaryTargets as any[], platform),
}),
)}
${chalk.gray(
`Note, that by providing \`native\`, Photon automatically resolves \`${platform}\`.
Read more about deploying Photon: ${chalk.underline(
'https://github.com/prisma/prisma2/blob/master/docs/core/generators/photonjs.md',
)}`,
)}\n`)
} else {
console.log(
`${chalk.yellow('Warning')} The binaryTargets ${JSON.stringify(
binaryTargets,
)} don't include your local platform ${platform}, which you can also point to with \`native\`.
In case you want to fix this, you can provide ${chalk.greenBright(
`binaryTargets: ${JSON.stringify(['native', ...(binaryTargets || [])])}`,
)} in the schema.prisma file.`,