Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert undefined or null to object on server code #307

Open
lamngo255 opened this issue Dec 31, 2024 · 1 comment
Open

Cannot convert undefined or null to object on server code #307

lamngo255 opened this issue Dec 31, 2024 · 1 comment

Comments

@lamngo255
Copy link

lamngo255 commented Dec 31, 2024

I'm writing unit test for server code, and encounter this issue:

● Test suite failed to run

TypeError: Cannot convert undefined or null to object
    at Function.getPrototypeOf (<anonymous>)

  22 | import { logger } from '../logger';
> 23 | import DOMPurify from 'isomorphic-dompurify';
     | ^
  24 |

FYI, we have a server running node 16, and can't update to version 18 due to the limitation of the current linux system. Therefore, I'm using isomorphic-dompurify version 1.9.0, and not the latest one. If I use node 18 and latest version (2.19.0), it's working fine.

What can be done to resolve it, any suggestions are highly welcomed!

@kkomelin
Copy link
Owner

Hey @lamngo255,
Sorry for not responding earlier. Was busy with other stuff.
I don't really know what to recommend in your case. Maybe try 1.8.0 or gradually downgrade to the point when it starts working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants