prisma / prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
https://www.prisma.io
Apache License 2.0
39.35k stars 1.54k forks source link

[Windows] Schema with Windows style absolute path leads to "error: Unexpected token. Expected one of: string interpolation start" on `generate` #1732

Open janpio opened 4 years ago

janpio commented 4 years ago

This schema.prisma:

   generator client {
     provider = "prisma-client-js"
     output   = "C:\Users\Jan\Documents\prisma-test-utils-automation\dbs\chinook\node_modules\prisma-client"
   }

leads to this error:

C:\Users\Jan\Documents\prisma-test-utils-automation (master -> origin) (prisma-test-utils-automation@0.0.0)
λ yarn prisma2 generate --schema=C:\\Users\\Jan\\Documents\\prisma-test-utils-automation\\dbs\\chinook\\schema.prisma
yarn run v1.21.1
$ C:\Users\Jan\Documents\prisma-test-utils-automation\node_modules\.bin\prisma2 generate --schema=C:\\Users\\Jan\\Documents\\prisma-test-utils-automation\\dbs\\chinook\\schema.prisma
Error: Schema parsing
error: Unexpected token. Expected one of: string interpolation start
  -->  schema.prisma:4
   |
 3 |      provider = "prisma-client-js"
 4 |      output   = "C:\Users\Jan\Documents\prisma-test-utils-automation\dbs\chinook\node_modules\prisma-client"
   |                    ^ Unexpected token.
   |

Validation Error Count: 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

(These paths are a bit unnatural, but are generated by prisma-test-utils-automation and should in theory just work)

pantharshit00 commented 4 years ago

@janpio are we sill using test utils?

janpio commented 4 years ago

Yes, not really relevant to the problem here though. The Windows style path was the problem.

pantharshit00 commented 3 years ago

This is still relevant in 2.22