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

Cannot find field on Go struct #117

Open
discount-elf opened this issue Dec 11, 2024 · 3 comments
Open

Cannot find field on Go struct #117

discount-elf opened this issue Dec 11, 2024 · 3 comments

Comments

@discount-elf
Copy link

discount-elf commented Dec 11, 2024

Utilizing:

pkl: 0.27.1 on MacOS
pkl-go: 0.8.1

I receive these info logs:

{"time":"2024-12-11T15:16:26.898523-06:00","level":"INFO","msg":"warn: Cannot find field on Go struct `pkl.ProjectEvaluatorSettings` matching Pkl property `color`. Ensure the Go structs are up to date with Pkl classes either through codegen or manually adding `pkl` tags."}
{"time":"2024-12-11T15:16:26.898544-06:00","level":"INFO","msg":"warn: Cannot find field on Go struct `pkl.ProjectEvaluatorSettings` matching Pkl property `externalModuleReaders`. Ensure the Go structs are up to date with Pkl classes either through codegen or manually adding `pkl` tags."}
{"time":"2024-12-11T15:16:26.898547-06:00","level":"INFO","msg":"warn: Cannot find field on Go struct `pkl.ProjectEvaluatorSettings` matching Pkl property `externalResourceReaders`. Ensure the Go structs are up to date with Pkl classes either through codegen or manually adding `pkl` tags."}
{"time":"2024-12-11T15:16:26.898551-06:00","level":"INFO","msg":"warn: Cannot find field on Go struct `pkl.Project` matching Pkl property `annotations`. Ensure the Go structs are up to date with Pkl classes either through codegen or manually adding `pkl` tags."}

Code:

evaluator, err := pkl.NewProjectEvaluator(context.Background(), projectDir, pkl.PreconfiguredOptions, func(opts *pkl.EvaluatorOptions) {
	opts.OutputFormat = "json"
})
@discount-elf
Copy link
Author

Not sure why this is being logged, as the NoopLogger is utilized via the pre-configured options.

@HT154
Copy link
Contributor

HT154 commented Dec 12, 2024

These messages are a product of a mismatch between Pkl and pkl-go versions. pkl-go v0.8.x is aligned with Pkl 0.26.x; there is no pkl-go release yet for Pkl 0.27.x.

Those messages are from the binary decoder, but the evaluator option for the logger only controls logging produced by the Pkl server. That said, it's definitely not ideal that these are logged globally. It's probably worth filing a separate issue about the logging.

@discount-elf
Copy link
Author

Thank you! Raised issue:
#118

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

2 participants