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

Example app for Dynamically Loaded Components returns null #1106

Open
rmorshea opened this issue Jul 15, 2023 Discussed in #1105 · 1 comment
Open

Example app for Dynamically Loaded Components returns null #1106

rmorshea opened this issue Jul 15, 2023 Discussed in #1105 · 1 comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release type-bug About something that isn't working

Comments

@rmorshea
Copy link
Collaborator

When running the following example:

from reactpy import component, run, web

mui = web.module_from_template(
    "react@^17.0.0",
    "@material-ui/[email protected]",
    fallback="⌛",
)
Button = web.export(mui, "Button")


@component
def HelloWorld():
    return Button({"color": "primary", "variant": "contained"}, "Hello World!")


run(HelloWorld)

I observe:

image

Discussed in #1105

Originally posted by AyushExel July 15, 2023
I'm following the example here https://reactpy.dev/docs/guides/escape-hatches/javascript-components.html#dynamically-loaded-components
And it works on the browser when clicking result button but on running it on my system, i get null page.
Screenshot 2023-07-15 at 8 20 12 PM

@rmorshea rmorshea added type-bug About something that isn't working priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release labels Jul 15, 2023
@Archmonger
Copy link
Contributor

This is likely an issue with our our view that serves JavaScript modules. We need to make sure we're appropriately setting mime type headers within this view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release type-bug About something that isn't working
Projects
None yet
Development

No branches or pull requests

2 participants