Closed sberyozkin closed 3 years ago
This may be caused by https://github.com/quarkusio/quarkus/pull/18227, I think the quickstarts need to be updated accordingly? /cc @mkouba
It is probably the DevServices console code in Quarkus which should pass io.quarkus.qute.strict-rendering=false
to Qute;
Or maybe the fact it is rendered async is what causes the problem ?
If no-one else is looking at this, I can have a look.
Adding strictRendering(false)
fix it. Not sure if that is the correct fix. I'll do a PR and we can discuss there ?
Ok, so the problem is that the data map has no key of value currentExtensionName
. We only add this to the data for non-main templates: https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsole.java#L111. Like I mentioned in https://github.com/quarkusio/quarkus/pull/18416#issuecomment-875517107 it wouldn't be a problem if it was null
.
So there are several ways how to fix this:
1) add .data("currentExtensionName", null)
even for the main page,
2) disable strict rendering,
3) modify the {#if currentExtensionName}
to something like:
a. {#if containsKey('currentExtensionName')}
-> this would work because the root data object is a map
b. {#if currentExtensionName.or(false)}
-> this would return false for "not found" and null
values
@mkouba what do you suggest ?
Well, the option 1 is quick but fixes only the problem with the main
template. Option 2 is a safe one because we don't have tests for all DEV UI pages and more of them could be broken. On the other hand, option 2 is a bit short-sighted. Option 3 is a bit cumbersome. I think that for now we should go with option 2.
I will create a separate issue to verify all DEV UI templates and possibly switch to strict rendering afterwards.
BTW I think that we should definitely improve the error message for this particular case (i.e. data map is missig a binding) and provide something less cumbersome to check the "not found" value in the {#if}
section.
So we should merge #18416 (option 2) for now ?
Describe the bug
Starting the quickstarts (I've tried
security-openid-connect-quickstart
followed bygetting-started
) withmvn quarkus:dev
and then accessing the console from the browser atlocalhost:8080/q/dev
fails with:CC @stuartwdouglas @phillip-kruger