Closed mungodewar closed 1 year ago
Why would you want to use console.warn inside server.js, anyways, since OC is going to ignore all messages?
Why would you want to use console.warn inside server.js, anyways, since OC is going to ignore all messages?
This is just an demo example of triggering the bug. What is really happening is a deep dependency within the react render tree is using a console.warn
statement. IMO usage of console.warn
shouldn't stop the component rendering within the oc-registry context.
Got it. LGTM then.
Got it. LGTM then.
I'll update my PR to your suggested change.
Who is the bug affecting?
Component authors/creators.
What is affected by this bug?
The ability to server-side render components.
When does this occur?
When trying to server render a component in production.
Where on the platform does it happen?
In the registry in production only. This issue is not present locally as the "real" console object is passed into the
vm
context. This makes this problem particularly dangerous.How do we replicate the issue?
console.warn
anywhere insideserver.js
.console.warn is not a function
error when trying to fetch/get component from registry.Expected behavior (i.e. solution)
console
api should be fully stubbed inside component server execution. I've drafted a PR: https://github.com/opencomponents/oc/pull/1315 that I hope details what I think should happen.What version of OC, Node.js and OS are you using?
oc@0.49.6 node@16.18.1
Other Comments