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

Formatter crashes on arbitrary blocks #13992

Closed
jkomyno opened this issue Jun 24, 2022 · 1 comment
Closed

Formatter crashes on arbitrary blocks #13992

jkomyno opened this issue Jun 24, 2022 · 1 comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines/formatter engine Issue in the Formatter Engine tech/engines Issue for tech Engines. topic: prisma format CLI: prisma format
Milestone

Comments

@jkomyno
Copy link
Contributor

jkomyno commented Jun 24, 2022

Link

https://prisma-errors.netlify.app/report/14087

Rust Stacktrace

Error: Command failed with exit code 101: /../node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x format -i /../libs/prisma/schema.prisma
thread 'main' panicked at 'internal error: entered unreachable code: Encountered impossible declaration during formatting: [Start { rule: arbitrary_block, pos: Position { pos: 675 } }, Start { rule: non_empty_identifier, pos: Position { pos: 675 } }, End { rule: non_empty_identifier, pos: Position { pos: 689 } }, Start { rule: WHITESPACE, pos: Position { pos: 689 } }, End { rule: WHITESPACE, pos: Position { pos: 690 } }, Start { rule: WHITESPACE, pos: Position { pos: 690 } }, End { rule: WHITESPACE, pos: Position { pos: 691 } }, Start { rule: BLOCK_OPEN, pos: Position { pos: 691 } }, Start { rule: NEWLINE, pos: Position { pos: 692 } }, End { rule: NEWLINE, pos: Position { pos: 693 } }, End { rule: BLOCK_OPEN, pos: Position { pos: 693 } }, Start { rule: WHITESPACE, pos: Position { pos: 693 } }, End { rule: WHITESPACE, pos: Position { pos: 694 } }, Start { rule: WHITESPACE, pos: Position { pos: 694 } }, End { rule: WHITESPACE, pos: Position { pos: 695 } }, Start { rule: WHITESPACE, pos: Position { pos: 695 } }, End { rule: WHITESPACE, pos: Position { pos: 696 } }, Start { rule: WHITESPACE, pos: Position { pos: 696 } }, End { rule: WHITESPACE, pos: Position { pos: 697 } }, Start { rule: WHITESPACE, pos: Position { pos: 697 } }, End { rule: WHITESPACE, pos: Position { pos: 698 } }, Start { rule: WHITESPACE, pos: Position { pos: 698 } }, End { rule: WHITESPACE, pos: Position { pos: 699 } }, Start { rule: WHITESPACE, pos: Position { pos: 699 } }, End { rule: WHITESPACE, pos: Position { pos: 700 } }, Start { rule: WHITESPACE, pos: Position { pos: 700 } }, End { rule: WHITESPACE, pos: Position { pos: 701 } }, Start { rule: WHITESPACE, pos: Position { pos: 706 } }, End { rule: WHITESPACE, pos: Position { pos: 707 } }, Start { rule: WHITESPACE, pos: Position { pos: 716 } }, End { rule: WHITESPACE, pos: Position { pos: 717 } }, Start { rule: WHITESPACE, pos: Position { pos: 717 } }, End { rule: WHITESPACE, pos: Position { pos: 718 } }, Start { rule: WHITESPACE, pos: Position { pos: 718 } }, End { rule: WHITESPACE, pos: Position { pos: 719 } }, Start { rule: WHITESPACE, pos: Position { pos: 719 } }, End { rule: WHITESPACE, pos: Position { pos: 720 } }, Start { rule: WHITESPACE, pos: Position { pos: 720 } }, End { rule: WHITESPACE, pos: Position { pos: 721 } }, Start { rule: WHITESPACE, pos: Position { pos: 721 } }, End { rule: WHITESPACE, pos: Position { pos: 722 } }, Start { rule: WHITESPACE, pos: Position { pos: 722 } }, End { rule: WHITESPACE, pos: Position { pos: 723 } }, Start { rule: WHITESPACE, pos: Position { pos: 723 } }, End { rule: WHITESPACE, pos: Position { pos: 724 } }, Start { rule: WHITESPACE, pos: Position { pos: 732 } }, End { rule: WHITESPACE, pos: Position { pos: 733 } }, Start { rule: WHITESPACE, pos: Position { pos: 739 } }, End { rule: WHITESPACE, pos: Position { pos: 740 } }, Start { rule: WHITESPACE, pos: Position { pos: 740 } }, End { rule: WHITESPACE, pos: Position { pos: 741 } }, Start { rule: WHITESPACE, pos: Position { pos: 741 } }, End { rule: WHITESPACE, pos: Position { pos: 742 } }, Start { rule: WHITESPACE, pos: Position { pos: 742 } }, End { rule: WHITESPACE, pos: Position { pos: 743 } }, Start { rule: BLOCK_CLOSE, pos: Position { pos: 743 } }, End { rule: BLOCK_CLOSE, pos: Position { pos: 744 } }, End { rule: arbitrary_block, pos: Position { pos: 744 } }]', libs/datamodel/core/src/reformat.rs:789:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   2: datamodel::reformat::Reformatter::reformat_generic_token
   3: datamodel::reformat::reformat
   4: prisma_fmt::format::run
   5: prisma_fmt::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    at makeError (/../node_modules/prisma/build/index.js:3673:18)
    at handlePromise (/../node_modules/prisma/build/index.js:4426:33)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async formatSchema (/../node_modules/prisma/build/index.js:89016:14)
    at async _Format.parse (/../node_modules/prisma/build/index.js:96304:16)
    at async main (/../node_modules/prisma/build/index.js:98081:18)

@jkomyno jkomyno added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/engines Issue for tech Engines. topic: prisma format CLI: prisma format team/schema Issue for team Schema. tech/engines/formatter engine Issue in the Formatter Engine labels Jun 24, 2022
@tomhoule
Copy link
Contributor

tomhoule commented Jul 7, 2022

Can confirm this was fixed by prisma/prisma-engines#3030

@tomhoule tomhoule closed this as completed Jul 7, 2022
@janpio janpio added this to the 4.1.0 milestone Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines/formatter engine Issue in the Formatter Engine tech/engines Issue for tech Engines. topic: prisma format CLI: prisma format
Projects
None yet
Development

No branches or pull requests

3 participants