formbricks / formbricks

Open Source Survey Platform
https://formbricks.com
Other
6.54k stars 1.1k forks source link

[BUG] ReferenceError: firstEnabledEnding is not defined #3044

Closed jonas-hoebenreich closed 1 week ago

jonas-hoebenreich commented 3 weeks ago

Issue Summary

It seems like one of our surveys is somehow misconfigured and causes the following error on each survey sync:

ReferenceError: firstEnabledEnding is not defined
    at o (/home/nextjs/apps/web/.next/server/chunks/8215.js:1:47212)
    at u (/home/nextjs/apps/web/.next/server/chunks/8215.js:1:48037)
    at /home/nextjs/apps/web/.next/server/app/api/v1/client/[environmentId]/website/sync/route.js:1:2912
    at Array.map (<anonymous>)
    at y (/home/nextjs/apps/web/.next/server/app/api/v1/client/[environmentId]/website/sync/route.js:1:2897)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/nextjs/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/home/nextjs/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874)
    at async eR.handle (/home/nextjs/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:37512)
    at async doRender (/home/nextjs/node_modules/next/dist/server/base-server.js:1377:42)

I've run all migrations and restarted Redis.

Steps to Reproduce

  1. Error is thrown on every survey sync, unfortunately the error message is too unspecific which makes it hard to find the misconfigured survey

Expected behavior

no error on survey sync :)

Other information

No response

Screenshots

No response

Environment

Desktop (please complete the following information)

- v2.4.3
mattinannt commented 2 weeks ago

@Dhruwang Can you please check if you can reproduce the issue? Flix is self-hosting Formbricks and is using website surveys.

Dhruwang commented 2 weeks ago

Hey @jonas-hoebenreich , can you confirm, which version of Formbricks are you using ? 😊

i investigated this issue and found out a problem in packages/lib/i18n in reverseTranslateSurvey function. So basically this function is used to transform surveys with i18n strings to survey with normal string. But this only runs for the older versions of Formbricks πŸ€”

jonas-hoebenreich commented 2 weeks ago

We are using v2.4.3 in the backend and the issue happened when trying to sync with an outdated version "/website/sync?version=1.6.5"

Dhruwang commented 1 week ago

Hey @jonas-hoebenreich, in order to fix that, you will need to update version from 1.6.5 to something greater than 2.0.0 which does not call reverse translate function πŸ˜ŠπŸ™ŒπŸ»