Openlayers 6 TypeError: URL.createObjectURL is not a function

933 Views Asked by At

I have a question, after i update the openlayers from 5.3.1 to 6.3.1, when i run test, jest or mocha, both show the error "TypeError: URL.createObjectURL is not a function", what is the reason?

Mocha-Webpack:

TypeError: URL.createObjectURL is not a function
    at eval (webpack:///./node_modules/ol/worker/webgl.js?:7:15)

Jest:

FAIL test/map.test.js ● Test suite failed to run

TypeError: URL.createObjectURL is not a function

> 1 | import {Vector as VectorLayer} from "ol/layer.js";
    | ^
0

There are 0 best solutions below