Skip to content

Example app for Dynamically Loaded Components returns null #1106

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

Closed
rmorshea opened this issue Jul 15, 2023 Discussed in #1105 · 2 comments
Closed

Example app for Dynamically Loaded Components returns null #1106

rmorshea opened this issue Jul 15, 2023 Discussed in #1105 · 2 comments
Labels
priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release

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 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.

@Archmonger
Copy link
Contributor

Closing this as module_from_template is deprecated and slated for removal

@Archmonger Archmonger closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2025
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
Projects
None yet
Development

No branches or pull requests

2 participants