Closed jplhomer closed 2 years ago
@frandiox any ideas on this and whether it's a quick fix?
@jplhomer I think the actual problem is when having a component exported twice, once as default and once as named export:
export const MyComponent = function() {}
export default MyComponent
This would get compiled to something like:
import MyComponent, * as namedImports from 'xyz'
export const MyComponent = namedImports.MyComponent
export default MyComponent
Which is obviously wrong because the identifier MyComponent
is declared twice. At least is not related to using the same name as Hydrogen components, which would be harder to fix I think 😅
Ahh good catch!
Describe the bug I think we have a naming issue in our
ClientMarker
wrapping logic. If a userland component is named the same thing as a Hydrogen component (and is not a default export, seemingly), the names clash and we get this error in the server console:To Reproduce
export default
toexport
Expected behaviour Names should not clash.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here. eg.