reflex-dev / reflex

🕸️ Web apps in pure Python 🐍
https://reflex.dev
Apache License 2.0
20.49k stars 1.18k forks source link

Reflex Frontend Exception in version 0.6.1 with env prod #4036

Open bertbarabas opened 2 months ago

bertbarabas commented 2 months ago

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:

Expected behavior No exception

Specifics (please complete the following information):

dentro-innovation commented 2 months ago

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

bertbarabas commented 2 months ago

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

dentro-innovation commented 1 month ago

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.