prettier: Errors with `dockerfile` parser
Hi.
I updated to 0.17.1 and trying to use new dockerfile parser to format dockerfile.
But it dies with error:
panic: runtime error: index out of range
RuntimeError: unreachable
at main.runtime.runtimePanicAt (wasm://wasm/main-004aad7a:wasm-function[211]:0x10867)
at main.runtime.lookupPanic (wasm://wasm/main-004aad7a:wasm-function[18]:0x1dff)
at main.github.com/reteps/dockerfmt/lib.formatRun (wasm://wasm/main-004aad7a:wasm-function[1788]:0xc012b)
at main.github.com/reteps/dockerfmt/lib.FormatNode (wasm://wasm/main-004aad7a:wasm-function[1780]:0xbe2c2)
at main.(*github.com/reteps/dockerfmt/lib.ParseState).processNode (wasm://wasm/main-004aad7a:wasm-function[1778]:0xbde86)
at main.(*github.com/reteps/dockerfmt/lib.ParseState).processNode (wasm://wasm/main-004aad7a:wasm-function[1778]:0xbdf31)
at main.formatBytes.command_export (wasm://wasm/main-004aad7a:wasm-function[1797]:0xc6475)
at formatDockerfileContents (file:///d:/projects/softvisio-node/cli/node_modules/@reteps/dockerfmt/dist/format.js:20:27)
at async printAstToDoc (file:///d:/projects/softvisio-node/cli/node_modules/prettier/index.mjs:20124:16)
at async coreFormat (file:///d:/projects/softvisio-node/cli/node_modules/prettier/index.mjs:20538:14)
Dockerfile:
RUN \
# cleanup
ls -la
Seems, that such comments syntax is not supported.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (15 by maintainers)
Commits related to this issue
- chore: update #441 test case — committed to un-ts/prettier by JounQin 2 years ago
- chore: update #441 test case — committed to un-ts/prettier by JounQin 2 years ago
- chore: update #441 test case (#443) — committed to un-ts/prettier by JounQin 2 years ago
- fix: fallback to sh printer when dockerfmt throws close #441 close #445 — committed to un-ts/prettier by JounQin 2 years ago
@MoKhajavi75 You can set
parser: shto override the default parser withoverridesas https://prettier.io/docs/configuration#configuration-overrides.I fixed this bug in https://github.com/reteps/dockerfmt/releases/tag/0.3.4