lukevella / rallly

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
https://rallly.co
GNU Affero General Public License v3.0
3.56k stars 338 forks source link

Setting the language in the profile results in all resourcerequests returning 404 #421

Closed nebulade closed 1 year ago

nebulade commented 1 year ago

When a user selects a language in the profile settings, no further resources will load. All requests to .js files and other assets result in a 404

The app as such works fine in english, once the NEXT_LOCALE "de" is set in the cookies, the app only responds with 404. Clearing the cookie there on the browser "fixes" the issue.

Sadly I don't know much about nextjs but it seems maybe it misses building some assets or so. I tried to debug this but also due to my limited knowledge I couldn't make the server more verbose.

For more context this is happening in the Cloudron app package and the original request is https://forum.cloudron.io/topic/8251/the-language-switch-does-not-work

The package uses the following in the Dockerfile:

RUN yarn --frozen-lockfile --no-cache --production
RUN yarn build && rm -rf /usr/local/share/.cache/yarn

and then runs the app as

yarn start

This is with rallly from sha 6332d6459ffefbea7ab925f508d05ae9e7d204d8

Any hints on where to look further to gather more info would be appreciated.

lukevella commented 1 year ago

The behaviour you described sounds like it would be something to do with the middleware.

It's possible that we are seeing different behaviours between your self-hosted instance and rallly.co which runs on vercel. I'll see if I can reproduce it first by running it inside a container.

nebulade commented 1 year ago

Thanks for the quick response. You can see this happening at this test deployment at https://rallly.nebulon.space/

Looking at the middleware code, that part seems fine as the page does rewrite the URL to /de after setting it to German.

lukevella commented 1 year ago

I haven't been able to reproduce the issue locally. If this issue is only happening in your environment that might make it a lot harder to debug. Have you been able to reproduce it locally by any chance?

lukevella commented 1 year ago

While I was looking at this I noticed some weird behaviour with the middleware. Seems next updated some syntax when it comes to these paths so I merged #423 to fix this.

Are you able to test these changes?

nebulade commented 1 year ago

Ah great, I was able to test this and it indeed fixed the issue! Thanks for the quick turnaround