-
Notifications
You must be signed in to change notification settings - Fork 62
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
render is not defined
when importing solid-js/web
as a namespace
#158
Comments
So the reason this happens is because we patch render to set window.dispose with a regex... We replace So in your case the code that is generated is: import { template as _$template } from "solid-js/web";
import { delegateEvents as _$delegateEvents } from "solid-js/web";
import { createComponent as _$createComponent } from "solid-js/web";
import { insert as _$insert } from "solid-js/web";
const _tmpl$ = /*#__PURE__*/_$template(`<button type="button">`);
import * as solid_web from "solid-js/web";
import * as solid from "solid-js";
function Counter() {
const [count, setCount] = solid.createSignal(1);
const increment = () => setCount(count() + 1);
return (() => {
const _el$ = _tmpl$();
_el$.$$click = increment;
_$insert(_el$, count);
return _el$;
})();
}
solid_web.window.dispose = render(() => _$createComponent(Counter, {}), document.getElementById("app"));
_$delegateEvents(["click"]); I'm not sure what the right strategy is here. Maybe just writing |
yeah I know how to get around this. Just not an obvious error to hit. Maybe something that could be considered when transforming the code |
I got this error when pasting from the Solid tutorial. I tried to troubleshoot |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@xpat This sounds like an unrelated issue, can you post your question in the SolidJS discord #support channel instead |
Using
render
fromsolid-js/web
when it is imported as a namespacecauses an error:
https://playground.solidjs.com/anonymous/aaaa8129-cbf3-4f01-9e67-f9e81f8f094a
The text was updated successfully, but these errors were encountered: