solidjs / solid-refresh

MIT License
86 stars 18 forks source link

Version 0.7.3 fails with Uncaught ReferenceError: _$$registry is not defined #58

Closed pedro00dk closed 9 months ago

pedro00dk commented 9 months ago

I'm testing some webpack setups solid-refresh, and after updating packages today, I found out that when I update solid-refresh from 0.7.2 to 0.7.3 the page does not load and fails with Uncaught ReferenceError: _$$registry is not defined. I did not test on vite though. If you need more details I can provide a repository for reproduction.

lxsmnsyc commented 9 months ago

It only doesnt break in 0.7.2?

pedro00dk commented 9 months ago

I tested all 0.7.x versions, it only breaks on 0.7.3. Repo: https://github.com/pedro00dk/solid-refresh-webpack-test The last commit is using 0.7.3, if you npm start it, you will get the following error in the browser console: image

Reset to previous commit git reset --hard @~ and run npm ci and npm start. It will work.

pedro00dk commented 9 months ago

By the way, I just saw 0.7.4 was released, the issue is still present.

lxsmnsyc commented 9 months ago
Screenshot 2024-02-16 at 2 24 02 PM

This is such a very weird issue. It's able to transform $$refresh but not for $$component and $$registry. I recall this same issue happening for other babel plugins because of how, I believe, the TypeScript preset is compiling imports into require calls.

Edit: Okay I think I might have found a solution