mmomtchev / node-gdal-async

Node.js bindings for GDAL (Geospatial Data Abstraction Library) with full async support
https://mmomtchev.github.io/node-gdal-async/
Apache License 2.0
124 stars 25 forks source link

vite build failed while updating dependencies #149

Closed glacier-bot closed 3 months ago

glacier-bot commented 3 months ago

Description

When I tried to import gdal-async in a Vue3+Vite project, I got this error.

[ERROR] No loader is configured for ".html" files: node_modules/.store/gdal-async@3.8.5/node_modules/gdal-async/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html

    node_modules/.store/gdal-async@3.8.5/node_modules/gdal-async/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:86:21:
      86 │       return require('./' + command)(self, argvx, callback);

Then I checked out the contents of index.html and found that index.html seems to be a test file.

Codes

<script setup lang="ts">
import gdal from 'gdal-async'
const dataset = gdal.open('test.shp')
</script>

Suggestion

I wonder if it is necessary for this index.html to be in the latest release version.

Dependencies

"gdal-async": "^3.8.5" "vite": "^5.0.12" "vue": "^3.4.15"

mmomtchev commented 3 months ago

gdal-async is a Node.js native library, it does not work in the browser