Conversation
🦋 Changeset detectedLatest commit: eafea45 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@augustjk just a ping since its React SSR related and we have had some comments back and forth on the issues. |
| Object.assign((React as any).default ?? React, { | ||
| createElement: wrapCreateElement(React.createElement), | ||
| }); | ||
| if (React.createElement.name !== 'litPatchedCreateElement') { |
There was a problem hiding this comment.
Couldn't litPatchedCreateElement be minified? I think it'd be safer to add a well-known property to the function in wrap-create-element.ts and check for that here. The property should be use computed property syntax to protect against minifiers and compilers.
There was a problem hiding this comment.
This is code meant to run in the server, though I suppose it's not impossible that server code could be minified.
There was a problem hiding this comment.
Since we have confirmation this fixes the issue for others, I'm happy to merge this as is. We can address it then if minification becomes an issue.
|
I have this issue and when I manually applied the fix proposed in this PR into my local node_modules, it solved the issue for me. 👍 |
| Object.assign((React as any).default ?? React, { | ||
| createElement: wrapCreateElement(React.createElement), | ||
| }); | ||
| if (React.createElement.name !== 'litPatchedCreateElement') { |
There was a problem hiding this comment.
Since we have confirmation this fixes the issue for others, I'm happy to merge this as is. We can address it then if minification becomes an issue.
Description
Added a guard to check if
React.createElementwas already patched withlitPatchedCreateElementto prevent adding to the stack multiple calls tolitPatchedCreateElement.Addresses issue #4986