You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
// : after parameter name is intentional
templ Template(invalid: string) {
<div/>
}
When I run templ generate I get an error like the following
(✗) Error generating code [ file=/home/rkolmos/projects/templ-error-location-repro/main.templ error=/home/rkolmos/projects/templ-error-location-repro/main.templ source formatting error: 14:22: missing ',' in parameter list ]
(✗) Event handler failed [ error=failed to generate code for "/home/rkolmos/projects/templ-error-location-repro/main.templ": /home/rkolmos/projects/templ-error-location-repro/main.templ source formatting error: 14:22: missing ',' in parameter list ]
(✗) Error [ error=failed to generate code for "/home/rkolmos/projects/templ-error-location-repro/main.templ": /home/rkolmos/projects/templ-error-location-repro/main.templ source formatting error: 14:22: missing ',' in parameter list ]
(✗) Command failed: generation completed with 1 errors
To me it looks like what is happening is that the reported location is the location in the generated go file. It would be helpful if templ mapped that error back to it's location in the templ file similar to what the LSP does. The error is especially confusing if it is the first time the go file has been generated because there is nothing to reference to see what the offending line of code is.
Would the project be open to either?
Mapping errors back to their location in the templ file.
Providing a way to make templ generate keep invalid generated go files
If either of these is valuable I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered:
Hey all,
I've got a very simple templ file
When I run
templ generate
I get an error like the followingTo me it looks like what is happening is that the reported location is the location in the generated go file. It would be helpful if templ mapped that error back to it's location in the templ file similar to what the LSP does. The error is especially confusing if it is the first time the go file has been generated because there is nothing to reference to see what the offending line of code is.
Would the project be open to either?
templ generate
keep invalid generated go filesIf either of these is valuable I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered: