bvaughn / react-error-boundary

Simple reusable React error boundary component
MIT License
6.84k stars 203 forks source link

Error while bundling with Vite.js #190

Closed AnoNate closed 3 weeks ago

AnoNate commented 1 month ago

Relevant code or config

What you did: bundled my app using vite.js — version 5.2.11

What happened:

Got an error while bundling my app with Vite.js - see screenshot:

Screenshot 2024-08-05 at 10 27 22 AM

Reproduction repository:

Problem description: See above

Suggested solution: Remove any module level directives.

bvaughn commented 1 month ago

Suggested solution: Remove any module level directives.

I don't think this is a viable solution, at least to my knowledge. This directive is required to work with React Server Components.

AnoNate commented 1 month ago

Got it. My stack is Laravel / Inertia.js / React.js, so I am not using node.js, Next.js or any javascript based server side. I don't know if this is a serious error, but I will report back if so. In any case I am very happy with your package as the built-in React Error Boundary did not work with my stack, but yours does (in development at least — pre bundle).

Perhaps it might be possible to add an option for users that use React with a traditional MVC server side framework?

bvaughn commented 1 month ago

I'm open to suggestions if you have something concrete. (Truthfully it's not very high priority to me though so I'm unlikely to look into it myself)

AnoNate commented 1 month ago

Ok, thanks. If it turns out to be a serious issue I will research it and get back to you if I come up with a possible solution. Looks like you don't have many users of your package that work with the Vite.js bundler, otherwise perhaps it might be a higher priority.

bvaughn commented 3 weeks ago

Going to close this issue for now since it doesn't seem likely to be picked up.