Closed 6643 closed 3 months ago
This might be a bug of solid-refresh v0.7.5, see https://github.com/web-infra-dev/rsbuild/issues/1963 for details.
@lxsmnsyc can you comment on this?
this happens to us too using esbuild. here's a comment + workaround from our repo:
// the solid-js transform for refs assumes its input is mutable, ie. not const:
// esbuild converts this for us in production builds, but it happens
// too late in the process for unbundled builds like this one. So
// instead we'll use babel to convert down to var scoped variables.
['@babel/plugin-transform-block-scoping'],
[babelFastRefreshPlugin, cSolidRefreshOptions],
[jsxTransform, cSolidOptions],
When I originally wrote this comment I may have blamed the base jsx transform rather than the refresh plugin, but it is true that this only happens when the refresh plugin is included!
Ok then lets move this to refresh.
Describe the bug
I saw this in solidjs-use. But failed in rsbuild. I don't know the reason why this report is wrong. Solidjs-use is written wrong. Or. Rsbuild was wrong. https://github.com/web-infra-dev/rsbuild/issues/1963
Your Example Website or App
https://github.com/web-infra-dev/rsbuild/issues/1963
Steps to Reproduce the Bug or Issue
https://github.com/web-infra-dev/rsbuild/issues/1963
Expected behavior
https://github.com/web-infra-dev/rsbuild/issues/1963
Screenshots or Videos
No response
Platform
Additional context
No response