Unidentified CSS loading problems, possibly timing-related? #264
Replies: 6 comments 1 reply
-
|
I've found a possible lead - this article: https://medium.com/better-programming/how-to-fix-the-failed-to-read-the-cssrules-property-from-cssstylesheet-error-431d84e4a139 I can't get hold of my tester right now to check if he has any browser extensions installed - but does Django-formset try to do anything with "all" stylesheets, and might sometimes be getting more than it expects, as described in the article? |
Beta Was this translation helpful? Give feedback.
-
|
That's interesting. I never encountered this error myself. Just for your understanding, django-formset creates its own CSS rules while bootstrapping the web components (aka Django widgets). |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Sorry it's taken me a little while to get back to this. With the debug version hooked into my project, I could see that the error originated at line 125 of helpers.ts. Accessing
(Unfortunately I didn't have my tester capture the raw error before I added a try/catch with debug message around the offending line, hence the slightly different line number shown in the screenshot). As you can see, the stylesheet in question is being loaded from google. I don't know why; For my own purposes, I've patched the code like this: I'm not a JavaScript guy, still less a TypeScript one, so you may well have a better solution here. But this solves my immediate problem. Hopefully it can be addressed in the next release so that I don't have to keep patching it when upgrading. |
Beta Was this translation helpful? Give feedback.





Uh oh!
There was an error while loading. Please reload this page.
-
I'm asking this as a question rather than raising a bug, as I don't know whether this is a defect in django-formset or a mistake in how I'm deploying it. Either way, I would greatly appreciate some help as we're rapidly approaching a ship date and I'm out of ideas.
For me, Formset has been behaving perfectly. However, one of my testers reports intermittent but very frequent javascript errors in the PhoneNumber, DateTime, and DjangoSelectizeCountry widgets. When these occur (which seems to be more often than not, for him) the widgets in question don't render properly and the form doesn't work. He's sent me this screenshot:
Most searches for that error relate to cross-domain issues, but on my site everything is being loaded through a single Nginx server (gunicorn for the Django and static web serving for JS and CSS files) so I don't think that's the issue here.
As mentioned, I haven't been able to reproduce this in Safari, Chrome, or Firefox on my M4 Mac. However, with the goal of testing everything, this evening I pulled an old and painfully slow Windows laptop off the shelf. In Chrome on that machine, I can fairly reliably trigger similar - but not identical - errors:
In this example, it's an image upload widget and the country selector that are not working.
The fact that this manifests on my slowest computer but not any of the three faster ones I tried (including Chrome on Windows on a slightly faster laptop) makes me wonder if it's a timing problem. But that's just a guess.
Unfortunately I'm not really a front-end developer (the last time I did anything browser-based professionally was nearly 20 years ago) so I'm unsure how to track down problems in modern javascript. I just have the minified files being statically served, not any sort of javascript build system. The top bug in the above screenshot clicks through to this location in the prettyprinted minified JS, if that helps:
Any suggestions would be extremely welcome at this point. I'm starting to think I might have to strip out these widgets if I can't fix it, which I really don't want to do as I like the modern feel they give to the site. But better a boring textbox than a form that doesn't work for some people.
Many thanks for any assistance.
Beta Was this translation helpful? Give feedback.
All reactions