geotiffjs / geotiff.js

geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
https://geotiffjs.github.io/
MIT License
845 stars 175 forks source link

Error while create Pool #392

Open majkelEXE opened 11 months ago

majkelEXE commented 11 months ago

geotiff version: 2.0.7

This line simply throws an error:

const pool = new Pool();
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
    at new NodeError (node:internal/errors:400:5)
    at Object.fileURLToPath (node:internal/url:1492:11)
    at new Worker (D:\WORK\mock-project\node_modules\web-worker\cjs\node.js:108:19)
    at create (file:///D:/WORK/mock-project/node_modules/geotiff/dist-module/worker/decoder.js:5:18)
    at file:///D:/WORK/mock-project/node_modules/geotiff/dist-module/pool.js:57:39
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_URL_SCHEME'
}
- error unhandledRejection: TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
    at new NodeError (node:internal/errors:400:5)
    at Object.fileURLToPath (node:internal/url:1492:11)
    at new Worker (D:\WORK\mock-project\node_modules\web-worker\cjs\node.js:108:19)
    at create (file:///D:/WORK/mock-project/node_modules/geotiff/dist-module/worker/decoder.js:5:18)
    at file:///D:/WORK/mock-project/node_modules/geotiff/dist-module/pool.js:57:39
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  digest: undefined
}
zhanghjtx commented 3 months ago

I have the same problem, have you solved it?