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
'SyntaxError: No identifiers allowed directly after numeric literal' in Safari #10621
Comments
@Maggie0002 Could you try it with all extensions disabled and in an incognito window? That error indicates that there's a syntax error in some JavaScript that's being ran. The JS bundle of the app doesn't change when you refresh the page; and if it was a problem in the Directus bundle, I would've expected it to show up every time you load the page, rather than sporadically. |
'Private Window' is Safari's equivalent of 'Incognito'. I tried quitting out of Safari and going back in (by quitting, I mean instead of closing all the windows and tabs, I right clicked the Safari app and quit the whole app and restarted it). Still the same issue, although that time it worked in the Private Window. I then cleared the cookies again, quit Safari and opened it again. Then was able to access it. Seemed to be a similar process I had to go through last time to clear the issue. I suspect it will come again and will try and hone the steps more. Just to confirm, it definitely didn't work in the Private Window before. When it reoccurs I will provide a screenshot of that too. |
Do you have any custom Directus (app) extensions? 🤔 |
Nope, no custom extensions. Here it is again, just reoccurred after closing all the windows with Command+Q, reopening and then going to the url again. Here is the Private Browser screenshot: I definitely haven't ruled out this being something Safari related, but as I haven't seen this anywhere else presumably a Safari bug + something about the Directus environment. |
Does cloudflare have any asset transformation magic? Something must be altering the JavaScript that's ran, but no clue what that something could be at this point.. |
Not that I am aware of, other than some compression of static JS. Strange that it is an intermittent issue, and only Safari (Firefox shows no problem on the same Cloudflare proxy). My money is on something in Directus triggering a bug in Safari but no worldly idea how to debug it. I will try and investigate further, and will also keep an eye out for the next Safari release to test on. |
@Maggie0002 See #10826 (comment). Seems like disabling Auto Minify and purging the cloudflare caches should help in this scenario 👍🏻 |
But do you know what causes it? Safari doesn't understand the JS native BigInt format. If there is a number like "123n" encountered, Safari treats it as a variable with an incorrect name. CF probably appends "n" to some integers to protect calculations from overflowing and...here we are! |
Also getting this, which kills sessions and logs out users, with Auth0 (with or without standard login enabled). ✅ removing Auto Minify of JS solved it. Thanks @rijkvanzanten for the hint and @Fell-x27 for the insights! 🤗 |
Preflight Checklist
Describe the Bug
I am running Directus 9.3 and accessing it using Safari (15.2). It has been working fine, but now for a second time when I access the admin panel I just see nothing at all except white. In the console there is the following message and nothing else:
SyntaxError: No identifiers allowed directly after numeric literal
In the tab at the top of the Safari page it is stuck on
Loading...
.There are no errors reported in the console of the running Directus instance other than a received and successful request:
22:36:00 ✨ request completed GET 200 /admin 4ms
I have tried clearing cookies, disabling all ad blockers, and still no joy. I have also tried in a Private Window on Safari and getting the same error. The API responses still work as expected. And when accessing the same URL from Firefox, it is working fine.
Directus is running on a VPS and accessed over the internet, using https. It is behind an NGINX instance acting as a reverse proxy:
To Reproduce
I am not sure what causes the issue so haven't been able to reproduce it. It is the second time I has occurred over the course of about 8 hours of work over 2 days.
Wish I could provide more details but there isn't anything else in the console.
Errors Shown
In the tab at the top of the Safari page it is stuck on
Loading...
.What version of Directus are you using?
9.3
What version of Node.js are you using?
v16.13.1
What database are you using?
Postgres
What browser are you using?
Safari
What operating system are you using?
Mac OS
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: