solid: Updating solid-js and babel-preset-solid to 0.24.0 break my buttons
Describe the bug
After upgrading the places I used onClick
are broken.
The examples: https://github.com/steelbrain/linter-ui-default/blob/2b2f2ca1ed449d4ec8e0f076020aec2831388ce8/lib/tooltip/message.tsx#L101
<div className={`linter-excerpt ${message.severity}`}>
{
// fold butotn if has message description
message.description && (
<a href="#" onClick={async () => await toggleDescription()}>
<span className={`icon linter-icon icon-${state.descriptionShow ? 'chevron-down' : 'chevron-right'}`} />
</a>
)
}
<div>
To Reproduce
Expected behavior Click should work
Reproduction This is reproducible inside Atom. I cannot seem to be able to make a separate reproduction outside Atom. https://github.com/steelbrain/linter-ui-default/
Downgrading Solid completely fixed the issue!
Additional context
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (29 by maintainers)
Commits related to this issue
- fix: update solid to 0.24.2 https://github.com/ryansolid/solid/issues/335#issuecomment-774642282 — committed to steelbrain/linter-ui-default by aminya 3 years ago
- fix: update solid to 0.24.2 https://github.com/ryansolid/solid/issues/335#issuecomment-774642282 — committed to steelbrain/linter-ui-default by aminya 3 years ago
- fix: update solid to 0.24.2 https://github.com/ryansolid/solid/issues/335#issuecomment-774642282 — committed to steelbrain/linter-ui-default by aminya 3 years ago
I’m surprised this ever worked after 0.20.0 since you were creating elements outside of a reactive root. Nesting is better. In this case where messages never update you might be fine with just using
.map
but it’s probably just good practice to use<For>
Parcel respects the
browser
field to my knowledge. It also was the library that introduced thesource
. Its low config makes it difficult to see exactly what is going on. I found some issue around parcel 2 and better electron support but I’m not sure I follow it completely. I can tell from the error what the issue is, but I don’t quite get why it’s happening or what to do about it. It’s clearly importing from themain
field which is for node environments (SSR) and you want the browser env which I have underbrowser
field. But how Parcel makes those decisions I have no way. I use Parcel in code sandbox without issue, but I’m not sure how to debug it since Parcel sort of just works or it doesn’t. No config to tweak.Ok I’ve released presets to work with Jest:
https://github.com/ryansolid/solid-jest
You can see them in use in solid-rx, solid-meta, solid-styled-components in this repo.
@ryansolid thank you very much. sorry for bothering, I think it was package-lock.json that I forgot to remove