contentful / rich-text

Libraries for handling and rendering Rich Text 📄
MIT License
549 stars 109 forks source link

rich-text-from-markdown crashes next app with "ReferenceError: wrap is not defined" in production #460

Open 1Ghasthunter1 opened 1 year ago

1Ghasthunter1 commented 1 year ago

Working with NextJS 13.0.2 and @contentful/rich-text-from-markdown. Things work all good in dev with npm run dev, but when production comes along and richTextFromMarkdown is not even called, just incorporated in a function in some way, the app seems to crash on client side on that specific page in which richTextFromMarkdown was initialized in.

The error specifically thrown in the browser is Uncaught (in promise) ReferenceError: wrap is not defined. I wish I could provide more about what's going wrong here, but there's no way to really debug this effectively as it doesn't happen in dev mode.

To sum up, this error only comes up whenever richTextFromMarkdown is just initialized somewhere, not even called, and only in prod environments.

z0al commented 2 months ago

Hey @1Ghasthunter1 , sorry for the delay here. Is this still happening?

If yes, could you please provide the full error stack trace to help narrow down the cause?