anothersmith / node-duckdb

DuckDB NodeJS bindings
MIT License
48 stars 12 forks source link

Failed to compile with webpack 4 #158

Open edwinjue opened 1 year ago

edwinjue commented 1 year ago

Hi, receiving these errors when compiling with webpack 4

[./node_modules/node-duckdb/build/Release/node-duckdb-addon.node] 279 bytes {main} [built] [failed] [1 error]
    + 1544 hidden modules

ERROR in ./node_modules/node-duckdb/dist/addon/duckdb.js
Module not found: Error: Can't resolve 'fs' in '/home/xxxx/projectRoot/node_modules/node-duckdb/dist/addon'
 @ ./node_modules/node-duckdb/dist/addon/duckdb.js 4:13-26
 @ ./node_modules/node-duckdb/dist/addon/index.js
 @ ./node_modules/node-duckdb/dist/index.js
 @ ./components/Map/index.js
 @ ./components/main/Desktop/index.js
 @ ./Routes.jsx
 @ ./App.jsx
 @ ./index.js

ERROR in ./node_modules/node-duckdb/build/Release/node-duckdb-addon.node 1:0
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
 @ ./node_modules/node-duckdb/dist/addon-bindings/connection-binding.js 6:23-76
 @ ./node_modules/node-duckdb/dist/addon-bindings/index.js
 @ ./node_modules/node-duckdb/dist/addon/duckdb.js
 @ ./node_modules/node-duckdb/dist/addon/index.js
 @ ./node_modules/node-duckdb/dist/index.js
 @ ./components/Map/index.js
 @ ./components/main/Desktop/index.js
 @ ./Routes.jsx
 @ ./App.jsx
 @ ./index.js
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
       4 modules
ℹ 「wdm」: Failed to compile.
edwinjue commented 1 year ago

Hi all, just wanted to provide a little background info regarding this request: https://gist.github.com/edwinjue/d06e12b1a351b9b3f31f770eea52a71e

Not sure if something like this is achievable using your library is it?

Thanks for your hard work. Keep it up!