reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Reflex Frontend Exception in version 0.6.1 with env prod

Open bertbarabas opened this issue 1 year ago β€’ 3 comments

Describe the bug The following exception occurs while uploading a file in 0.6.1 when launched with reflex run --env prod. It does not happen when just using reflex run.

[Reflex Frontend Exception] SyntaxError: JSON5: invalid end of input at 1:8594 at eb (_next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:49749) at eD (_next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:49092) at Object.string (_next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:45874) at er (_next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:41785) at Object.parse (_next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:49903) at _next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:76244 at _next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:76699 at Array.map () at _next/static/chunks/pages/_app-dc8f8a5668aa1ea4.js:1:76691 at Array.map ()

To Reproduce Steps to reproduce the behavior:

  • Upload a file with progress bar.

Expected behavior No exception

Specifics (please complete the following information):

  • Python Version: 3.12.3
  • Reflex Version: 0.6.1
  • OS: Ubuntu

bertbarabas avatar Oct 01 '24 15:10 bertbarabas

Experiencing the same error message using Granian when deploying my reflex app via the docker prod setup and trying to upload an image:

[Reflex Frontend Exception]
 eb@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47d64266
a3f296.js:1:47543
eD@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47d64266a
3f296.js:1:46875
string@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47d64
266a3f296.js:1:43657
er@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47d64266a
3f296.js:1:39568
parse@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47d642
66a3f296.js:1:47686
8201/connect/<@https://staging.note-this-down.com/_next/static/chunks/pages/_app
-1e47d64266a3f296.js:1:70532
8201/uploadFiles/o/</<@https://staging.note-this-down.com/_next/static/chunks/pa
ges/_app-1e47d64266a3f296.js:1:70988
8201/uploadFiles/o/<@https://staging.note-this-down.com/_next/static/chunks/page
s/_app-1e47d64266a3f296.js:1:70979
o@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47d64266a3
f296.js:1:70947
6154/e4/<@https://staging.note-this-down.com/_next/static/chunks/pages/_app-1e47
d64266a3f296.js:27:37422

Locally with just running reflex run I can upload images without problem using Granian.

Also on python 3.12, reflex 0.6.1, and ubuntu

dentroai avatar Oct 01 '24 21:10 dentroai

I re-tried this from scratch. First locally where everything worked then again on aws with a nginx proxy server and https.

Everything worked for: reflex run

But for reflex run --env prod

This time the web socket had issues (see screen shot below). I kill the test and retried reflex run on aws, and again everything worked.

image

bertbarabas avatar Oct 01 '24 22:10 bertbarabas

Could this be a 0.6.1 issue in general? Using uvicorn I got the same error on the deployed instance:

[Reflex Frontend Exception]
 ev@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d7970079fd
e89f3a.js:1:49052
eD@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d7970079fde
89f3a.js:1:48384
string@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d797007
9fde89f3a.js:1:45166
er@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d7970079fde
89f3a.js:1:41077
parse@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d7970079
fde89f3a.js:1:49195
8201/connect/<@https://staging.note-this-down.com/_next/static/chunks/pages/_app
-d7970079fde89f3a.js:1:71878
8201/uploadFiles/o/</<@https://staging.note-this-down.com/_next/static/chunks/pa
ges/_app-d7970079fde89f3a.js:1:72334
8201/uploadFiles/o/<@https://staging.note-this-down.com/_next/static/chunks/page
s/_app-d7970079fde89f3a.js:1:72325
o@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d7970079fde8
9f3a.js:1:72293
6154/e4/<@https://staging.note-this-down.com/_next/static/chunks/pages/_app-d797
0079fde89f3a.js:31:37422

Downgrading to 0.6.0 uploading images works again.

dentroai avatar Oct 03 '24 14:10 dentroai

are any of these issues still happening?

adhami3310 avatar Feb 22 '25 17:02 adhami3310

TLDR: I can no longer reproduce the exception nor the websocket errors I experienced before.

It took a while but I finally got my app running again on AWS EC2 x86 with: Python Version: 3.12.3 Reflex Version: 0.7.0 OS: Ubuntu 24.04 nginx ssl

Of course my app has also changed in the mean time but I think the upload is mostly the same so I think we can say the the issue is solved. Here's a screen shot in case you care about other unrelated console messages, all messages appear before I start interacting with the screen:

Image

bertbarabas avatar Feb 23 '25 20:02 bertbarabas

It seems to be fixed then, i wonder what it was

adhami3310 avatar Feb 23 '25 22:02 adhami3310