question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma errors when not using the major.minor.patch versioning system

See original GitHub issue

Bug description

I recently changed my versioning system to use architecture.major.minor.patch instead of the usual major.minor.patch. When I did this and run npx prisma introspect, it errors with “Invalid version”

HZfj3D

It does not make any sense that prisma would complain about this.

How to reproduce

  1. Go to package.json
  2. Change “version” to “0.1.0.0”
  3. Run npx prisma introspect
  4. See error “Invalid version”

Expected behavior

Prisma should be able to accept a versioning system that is not the usual major.minor.patch, so long as it is a string.

Prisma information

Not required

Environment & setup

  • OS: Windows 10
  • Database: MySQL
  • Node.js version: 16.1.0

Prisma Version

prisma               : 2.23.0
@prisma/client       : 2.22.1
Current platform     : windows
Query Engine         : query-engine adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules\@prisma\engines\query-engine-windows.exe)
Migration Engine     : migration-engine-cli adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary        : prisma-fmt adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : adf5e8cba3daf12d456d911d72b6e9418681b28b
Studio               : 0.393.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pantharshit00commented, May 28, 2021
code/reproductions/issue_7317 is 📦 v0.1.0.0 via  v14.17.0
❯ DEBUG=* prisma introspect
  prisma:loadEnv project root found at C:\Users\harshit\code\reproductions\issue_7317\package.json +0ms
  prisma:tryLoadEnv Environment variables not found at null +0ms
  prisma:tryLoadEnv Environment variables loaded from ./prisma/.env +1ms
Environment variables loaded from prisma\.env
  prisma:engines using NAPI: false +0ms
  prisma:engines binaries to download query-engine, migration-engine, introspection-engine, prisma-fmt +0ms
Error: Error: Invalid version: "0.1.0.0"
    at Object.fixVersionField (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:9584:15)
    at C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:9900:40
    at Array.forEach (<anonymous>)
    at normalize (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:9899:17)
    at module2.exports (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:9926:26)
    at async Object.module2.exports [as default] (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:9957:20)
    at async getSchemaPathFromPackageJson (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:10017:21)
    at async getSchemaPathInternal (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:10008:36)
    at async DbPull2.parse (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:63731:24)
    at async main (C:\Users\harshit\AppData\Roaming\npm\node_modules\prisma\build\index.js:109791:18)
0reactions
ghostcommented, May 28, 2021

This is definitely unexpected @HurricaneDancer - a side effect of a library we are using. We will try to get rid of that. Sorry.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message reference - Prisma
Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error...
Read more >
npx prisma db push throws Invalid version: "0.1.0.6" #13243
So the theory is that setting an "invalid" (non semver MAJOR.MINOR.PATCH) version in the project's package.json file leads to an error when ...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
Precedence MUST be calculated by separating the version into major, minor, patch and pre-release identifiers in that order (Build metadata does not figure...
Read more >
Prisma Cloud container images - Palo Alto Networks
Current Version: Prisma ... Manage > System > Utilities ... where X is the major version, Y is the minor version, and Z...
Read more >
prisma - PyPI
Prisma Client Python is not stable. Breaking changes will be documented and released under a new MINOR version following this format. MAJOR ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found