Hi, so, 1/2 in 10 times loading into my server (building prod. files before joining increases chances to 60/70% or more) CEF just can’t load bundled create-react-app.
The problem is with js bundled file, where it shows that it as an Uncaught SyntaxError: Invalid or unexpected token
.
Thought that it might be a filesize limit, so then I split the bundle into chunks, same problem, now when loading a chunk! (sometimes even more than one)
Tried searching the problem, in some forum someone recomended not minifying the files. After that, the issue is even more hilariously xd (more below).
This is my last attempt with not minified bundled files:
-
Dist directory:
-
Nui devtools: (before with the minified version, I couldnt even tell the line where it failed)
If we go to the fileui/build/static/js/3.chunk.js#6029
to find out the “syntax error”:
No issue whatsoever.
And the cherry on top is that, whenever this problem occurs, a client file also seems to fail to load.
This client file is mainly responsible for creating a “bridge” with the “hud” and other resources, and is only being imported from other resources aswell.
The error occurs in a randomly resource that imported the file, printing the exception Error parsing script: (...):1 unexpected symbol near '</127>'
and failing everything that depends on that import:
And that line doesn’t have anything in it.
Restarting the resources affected by this (first “vv-hud”, then the other ones) makes everything work again fine, so, first-load related?
I don’t have a clue in why this is happening (specially the client file part) neither reproduction steps, besides percentages.
Also, when researching, someone mentioned that cef logs would paint a better picture in what is happening, but couldnt find them inside fivem app data (or I’m just blind ).
To wrap everything up, I tried mentioning this issue in discord some time ago, when another user also mentioned something similar but with vue (same nui error).
Any help is appreciated and I can provide some of the files or logs if needed to somehow reproduce this.