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

Upgrading from 1.2.1 to 1.2.2 (and beyond) breaks react-live #2321

Closed
selbekk opened this issue Mar 15, 2022 · 3 comments
Closed

Upgrading from 1.2.1 to 1.2.2 (and beyond) breaks react-live #2321

selbekk opened this issue Mar 15, 2022 · 3 comments
Labels
bug Something isn't working external

Comments

@selbekk
Copy link

selbekk commented Mar 15, 2022

What version of Remix are you using?

1.2.2 (and 1.2.3)

Steps to Reproduce

I've created a reproduction here: https://github.com/selbekk/remix-react-live-repro

Steps I followed to create this repro:

  • Run npx create-remix@latest
  • Choose Remix App Server, install deps and enter folder
  • Run npm install react-live@next
  • Add the code below to show a very basic live code editor
  • Downgrade to 1.2.2 and see that the error is there still
  • Downgrade to 1.2.1 and see that the error is not there anymore.

This sounds like a react-live bug, but when I debugged this (for daaaays), it looks like a compilation bug.

This crashes because of a compilation error. It says the import_NameManager.default is not a constructor. That's correct (even though it should be) - it's an object containing the "default" property, which in turn includes the NameManager constructor. So it looks like it has something to do with compiling Sucrase!

Here's a typical place in the compiled code (found in public/build) where it's used:

image

After fixing this one-off mistake, I notice that this happens with all default exports - and that's why I think it's a compilation level issue that might be addressed here.

It definitely sounds like it has something to do with #1998, but as far as I can see, Sucrase doesn't do the faulty default export thing this issue warns about. I can't see it in the compiled code either, so I'm not sure where to look next. However, this issue in Sucrase also sounds related - it's the same issue, just a different class.

Any help would be greatly appreciated!

Expected Behavior

I would expect it to work

Actual Behavior

I get a compilation error!

@nihgwu
Copy link

nihgwu commented Mar 25, 2022

I proposed the solution in the licked issue, but it only works for Vite, how can I alias module resolution in Remix?

@MichaelDeBoey
Copy link
Member

This seems to be a bug in react-live in combination with esbuild, so I'm going to close this one for now.

@nihgwu
Copy link

nihgwu commented Mar 25, 2022

@MichaelDeBoey can you open the ticket, here is the answer from the author of esbuild, it would be nice we can config esbuild via remix.config
related to #1405, it would be nice if we can provide a way to alias module resolution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external
Projects
None yet
Development

No branches or pull requests

3 participants