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

Windows spatial extension fails to load #409

Closed
DrewScatterday opened this issue Sep 23, 2024 · 1 comment
Closed

Windows spatial extension fails to load #409

DrewScatterday opened this issue Sep 23, 2024 · 1 comment

Comments

@DrewScatterday
Copy link
Contributor

Code:

const duckdb = require("duckdb");

function queryWithCallback(conn, sql) {
	return new Promise((resolve, reject) => {
		conn.all(sql, (err, result) => {
			if (err) {
				reject(err);
			} else {
				resolve(result);
			}
		});
	});
}

async function main() {
	const db = new duckdb.Database(":memory:");
	var sqlQuery = `FORCE INSTALL spatial;
					LOAD spatial;
					CREATE TABLE t1 AS SELECT point::GEOMETRY as geom
					FROM st_generatepoints({min_x: 0, min_y: 0, max_x: 100, max_y: 100}::BOX_2D, 10_000, 1337);
					SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(45, 45, 65, 65));`
	const rows = await queryWithCallback(db, sqlQuery);
	console.log(rows);
	console.log("🦆 DuckDB initialized 🦆");
}

main();

Tested this script on both a fresh windows 10 and fresh windows 11 VM with node 20.11.1 and both fail with an error:

[Error: IO Error: Extension "\.duckdb\extensions\v1.1.0\windows_amd64\spatial.duckdb_extension" could not be loaded: The specified module could not be found.
] {
  errno: -1,
  code: 'DUCKDB_NODEJS_ERROR',
  errorType: 'IO'
}

I'm not sure if this is related to my other issue #405 but something weird seems to be going on with Windows builds

@DrewScatterday
Copy link
Contributor Author

DrewScatterday commented Sep 23, 2024

updating/installing latest MSVC from this comment duckdb/duckdb#13848 (comment) fixed it on win 10 and win 11 but I think the binary is still broken

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

1 participant