accessibility icon indicating copy to clipboard operation
accessibility copied to clipboard

Nextjs runtime error

Open rtgfxp opened this issue 1 year ago • 7 comments

on loading with nextjs 14 I'm getting this runtime error: ⨯ node_modules\accessibility\dist\accessibility.js (124:0) @ eval ⨯ ReferenceError: window is not defined

rtgfxp avatar Jun 14 '24 12:06 rtgfxp

It looks like you are trying to run the module in a Node.js environment, not on browser. Obviously it's meaningless. Please try version 5.1.1 and let me know if the issue has been fixed.

ranbuch avatar Jun 15 '24 08:06 ranbuch

I installed the new version, still getting this message I will note that it upload but sometimes disappears, crashes nextjs 14 - client component

rtgfxp avatar Jun 15 '24 12:06 rtgfxp

There are 2 cenarios that I can think of that might results to this error message window is not defined. Running code on server side (node.js) or running code on a service or web worker (or any other headless mode). In any of those cases this code shouldn't be running as it depends on the DOM.

If you want me to investigate further please reproduce on stackblitz or something similar.

ranbuch avatar Jun 15 '24 14:06 ranbuch

Because of the structure of NextJS, this environment also ran on NodeJS I run the component on client side (client component) and its run on the browser

rtgfxp avatar Jun 15 '24 14:06 rtgfxp

I have no experience with NextJS but if you are getting this error the code is also running on your back-end. Please try version 5.1.3 and keep me posted.

ranbuch avatar Jun 15 '24 15:06 ranbuch

In a development environment it does not uploaded at all In a production environment it works correctly

rtgfxp avatar Jun 15 '24 16:06 rtgfxp

Again, I'm in the dark here. Please reproduce on Stackblitz or something similar.

ranbuch avatar Jun 15 '24 16:06 ranbuch