Skip to content

Found invalid node root #116

@ptman

Description

@ptman

Testing prettier --parser go-template -w test.html with test.html being

<svg><use></svg>

gives:

[error] ../../test.html: Error: An error occured during printing. Found invalid node root.
[error]     at Object.print (/nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier-plugin-go-template/lib/index.js:65:19)
[error]     at callPluginPrintFunction (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/index.mjs:22303:20)
[error]     at printAstToDoc (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/index.mjs:22258:22)
[error]     at async coreFormat (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/index.mjs:22611:14)
[error]     at async formatWithCursor (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/index.mjs:22809:14)
[error]     at async formatFiles (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/internal/cli.mjs:6673:18)
[error]     at async main (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/internal/cli.mjs:7081:5)
[error]     at async Module.run (file:///nix/store/1lhkxfwy9cyixyxfg4ww74vz64haxzmc-prettier-gohtml-nix-0/node_modules/prettier/internal/cli.mjs:7027:5)

MDN thinks use inside svg is pretty common: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions