Frojd / django-react-templatetags

A quick way to add React components to your Django templates.
MIT License
439 stars 38 forks source link

Hypernova SSR not propagating errors correctly #52

Open rinti opened 4 years ago

rinti commented 4 years ago

This problem might be with hypernova-python plugin. The error gets stuck inside "results" and not at the base dictionary. Eventhough I get the response that everything is OK, the SSR failed.

This is a snippet of the JSON returned from https://github.com/ornj/hypernova-python/blob/master/hypernova/__init__.py#L79

{
  "success": True,
  "error": "None",
  "results": {
    "Components.App": {
      "name": "Components.App",
      "html": "None",
      "meta": {

      },
      "duration": 310.156114,
      "statusCode": 500,
      "success": False,
      "error": {
        "name
        ":"
        ReferenceError ",
        "message": "window is not defined",
        "stack": [
          "ReferenceError: window is not defined",
          "at useMediaQuery (/mnt/persist/www/signalisten/shared/ssr/frontend/ssr_frontend/utils/useMediaQ
          uery.js: 37: 25)
        ",
        ]
}
marteinn commented 4 years ago

Thanks @rinti! Will investigate what the proper Hypernova result should look like and make sure hypernova-python follows that structure.