ERROR - Cert-verifier-js XMLHttpRequest

Hi all, i have installes cert-verifier-js…and i am work with node js but when use ES to import the module “@blockcerts/cert-verifier-js” i´m getting the next error:

TypeError: F.XMLHttpRequest is not a constructor

Here is my import code:

import { Certificate } from ‘@blockcerts/cert-verifier-js’;

Hi @Cristian,

to run in a node environment you need to use the code exposed in the lib directory, as follows:

const certVerifierJs = require('@blockcerts/cert-verifier-js/lib');

This is highlighted in the readme: https://github.com/blockchain-certificates/cert-verifier-js#running-in-nodejs. This readme is fairly comprehensive so you can use it for reference.

1 Like

Hi @lemoustachiste thanks…
But a tried this way too and I got the same error.

could you open a detailed issue in the cert-verifier-js repo?

Thanks