Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
702 stars 197 forks source link

[Bug]: [NEXTJS 14] Using hooks on the server side, you must explicitly specify ssr = true option #476

Closed w1png closed 1 month ago

w1png commented 1 month ago

Telegram Application

Other

Describe the Bug

Dev mode works fine but when I do bun run build or npm run build i get this error. Also dynamic imports fix the error but the app becomes slow.

I am using ssr=true as mentioned in the docs and the error message.

Example:

  const cloudStorage = useCloudStorage(true);
  const initData = useInitData(true);

To Reproduce

Make a nextjs14 Mini App. Try to build it.

Expected Behavior

A working application.

w1png commented 1 month ago

Missed ssr=true in 1 hook inside layout. My bad