Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot-Reload fails with “Unexpected token '['. Expected opening '{' at the start of a class body.” #1605

Open
MilanDeruelle opened this issue Mar 17, 2021 · 1 comment
Assignees

Comments

@MilanDeruelle
Copy link

Hi!
I'm having some trouble with chakra-ui in combination with react-hot-loader.
I've posted a stackoverflow question describing the issue. Any help/input would be greatly appreciated or in case this is actually a bug, I'd gladly file a real bug-report.

@theKashey
Copy link
Collaborator

Sounds like this moment is causing the problem -

return class ${InitialParent.name || 'HotComponent'} extends InitialParent {

We are trying to create a component with the same name as you have, however a lot of HOC produces a name, which is not "js friendly".

  • It's not a bug for "good citizens" as they use .displayName, not name
  • It's a bug for the functionality which modifies .name, while it should not

It can be solved on RHL side, but please find the root cause, the functionality which generates the incorrect name and open an issue for them as well.

@theKashey theKashey self-assigned this Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants