Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix @edgedb/generate issue Error SchemaDefinitionError specified migration parent is not the most recent migration, expected #1

Open
krutilins opened this issue Nov 16, 2022 · 1 comment

Comments

@krutilins
Copy link

windows 11
node v14.19.0
yarn 1.22.18

  1. if the folder with the name generated was not created manually, it will throw an error
$ yarn generate:edgeql:client && yarn generate:edgeql:queries
yarn run v1.22.18
$ npx @edgedb/generate edgeql-js --output-dir ./generated/edgeql --target cjs --force-overwrite
Generating query builder...
Introspecting database schema...
(node:21456) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, mkdir 'C:\Documents\edgedb-nestjs-example\generated\edgeql'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21456) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:21456) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 1.42s.
  1. there was some updates in @edgedb/generated, which probably conflicts with edgedb package
$ npx @edgedb/generate queries --file ./generated/edgeql/queries --target cjs --force-overwrite
Generating functions from .edgeql files...
Detected project root via edgedb.toml:
   C:\Documents\edgedb-nestjs-example
Connecting to database...
Analyzing .edgeql files...
   ./../C:\Documents\edgedb-nestjs-example\dbqueries\getUserByEmail.edgeql
   ./../C:\Documents\edgedb-nestjs-example\dbschema\migrations\00001.edgeql
(node:28116) UnhandledPromiseRejectionWarning: Error: SchemaDefinitionError: specified migration parent is not the most recent migration, expected 'm1tcya4emanq45tktoqkca64w6xvriojendyqhwk7lmbssdigrhjpq'
    at Object.analyzeQuery (C:\Documents\edgedb-nestjs-example\node_modules\edgedb\dist\reflection\analyzeQuery.js:26:15)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async generateQueryFiles (C:\Documents\edgedb-nestjs-example\node_modules\@edgedb\generate\dist\queries.js:37:27)
    at async run (C:\Documents\edgedb-nestjs-example\node_modules\@edgedb\generate\dist\cli.js:264:13)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28116) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 0.85s.
@krutilins
Copy link
Author

krutilins commented Nov 16, 2022

suggested solutions:

  1. probably it's an issue only for windows machine
  2. update @edgedb/generate to ^0.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant