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
This is on Components.js version 4.5.0, I did not check yet if this would be fixed with the new upcoming major release. Will check later to determine if the issue has to be moved there.
One consequence of this is that stack traces now always get printed on error pages with no way to disable it.
As a workaround, we could rewrite the KeyExtractor constructor as:
publicconstructor(key: string,defaultValue?: number |boolean|unknown)
It appears that the order of the union declaration determines how Components.js tries to parse the value: first as number, then boolean, and then fallback to how it behaves currently (parse as string). A drawback of this approach is that e.g. "3000" will be parsed as a number and not as a string..
An alternative solution could be to add an optional parameter that allows to specify the type explicitly (enabling KeyExtractor to handle edge cases).
I've fixed this in Components.js (with the help of @rubensworks). The fix is being released as 5.2.0.
Do I create a chore for updating the Components.js dependency?
This seems to be the case (I did a quick test by having the server return a 404 for a non-existing container, the stack trace is gone when using Components.js 5.2.0). This is the desired behaviour?
Activity
jvherweg commentedon Mar 1, 2022
Did a test on Component.js v5/Generator v3 and unfortunately the issue is still there. We might have to look into a solution to work around that.
wkerckho commentedon May 11, 2022
As a workaround, we could rewrite the
KeyExtractorconstructor as:It appears that the order of the union declaration determines how Components.js tries to parse the value: first as number, then boolean, and then fallback to how it behaves currently (parse as string). A drawback of this approach is that e.g.
"3000"will be parsed as a number and not as a string..An alternative solution could be to add an optional parameter that allows to specify the type explicitly (enabling
KeyExtractorto handle edge cases).jvherweg commentedon May 11, 2022
We should probably first investigate how much effort this would be to fix in Components.js itself. And with "investigate" I mean poking @rubensworks.
rubensworks commentedon May 12, 2022
Sounds like a bug to me.
Probably something small here: https://github.com/LinkedSoftwareDependencies/Components.js/blob/master/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.ts#L93-L156
Preserve literal values for params with type unknown
wkerckho commentedon May 20, 2022
I've fixed this in Components.js (with the help of @rubensworks). The fix is being released as 5.2.0.
Do I create a chore for updating the Components.js dependency?
jvherweg commentedon May 20, 2022
Yes please, thanks!
So starting the server with no extra CLI parameters no longer shows the stack trace in case of errors then?
wkerckho commentedon May 24, 2022
This seems to be the case (I did a quick test by having the server return a 404 for a non-existing container, the stack trace is gone when using Components.js 5.2.0). This is the desired behaviour?
jvherweg commentedon May 24, 2022
Yes it is, it should only appear when you start the server with the
-tflag, which is parsed by the classes mentioned above.jvherweg commentedon Jun 1, 2022
Done in #1333