toss / suspensive

Manage asynchronous operations, timing, error handling and detecting intersection of elements easily (one of TanStack Query's community resources)
https://suspensive.org
MIT License
528 stars 51 forks source link

[Bug]: `forwardRef is not defined` client-side error in Next.js production builds #583

Closed relsunkaev closed 9 months ago

relsunkaev commented 9 months ago

Package Scope

@suspensive/react

Bug description

After updating to 1.20.10 the app throws a client-side error

ReferenceError: forwardRef is not defined

Expected behavior

No client-side error

To Reproduce

Use the ErrorBoundary component anywhere in the app. Only happens in production builds, webpack is used for both (no --turbo flag in dev).

Using Next.js 14.0.4 with standalone output and outputFileTracingRoot set (monorepo setup likely not required to reproduce).

Possible Solution

Could be issues with treeshaking/minification, that's what 1.20.10 introduced. Downgrading to 1.20.9 resolves the issue.

etc.

No response

manudeli commented 9 months ago

I reproduced it in my next.js repo I found bug too. I made fixed new version in v1.23.2 but Could you check whether v1.23.2 fix your issue please too? In my repository, issue is gone.

manudeli commented 9 months ago

If this version resolve your issue, close this issue please. Thanks for your help! 🙇

manudeli commented 9 months ago

@minsoo-web @okinawaa Check it out please