sql.js icon indicating copy to clipboard operation
sql.js copied to clipboard

electron-webpack build

Open eightfivelabs opened this issue 5 years ago • 3 comments

Hi there,

I am using electron-webpack to pack sql.js into an electron app, but getting the below errors. The first error appears to have an issue with the sql-wasm.wasm file.

Uncaught SyntaxError: Invalid or unexpected token

The second error is because electron-webpack seems to want to still load the sql-wasm.wasm file from node_modules despite being copied over to js/sql-wasm.wasm output already.

/home/stuart/dev/ele…ist/sql-wasm.js:167 GET http://localhost:9080/home/stuart/dev/electron-svelte-typeorm-typescript/node_modules/sql.js/dist/sql-wasm.wasm 404 (Not Found)

/home/stuart/dev/ele…ist/sql-wasm.js:167 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': HTTP status code is not ok

/home/stuart/dev/ele…ist/sql-wasm.js:167 falling back to ArrayBuffer instantiation

GET http://localhost:9080/home/stuart/dev/electron-svelte-typeorm-typescript/node_modules/sql.js/dist/sql-wasm.wasm 404 (Not Found)

Any thoughts would be appreciated. The sample repo is at https://github.com/eightfivelabs/electron-svelte-typeorm-typescript

eightfivelabs avatar Jun 15 '20 15:06 eightfivelabs

Hello, If you want a demo of how to use sql.js with webpack, have a look at https://github.com/sql-js/react-sqljs-demo

lovasoa avatar Jun 15 '20 15:06 lovasoa

Hello, If you want a demo of how to use sql.js with webpack, have a look at https://github.com/sql-js/react-sqljs-demo

Thanks @lovasoa, but unfortunately hasn't helped in my situation.

eightfivelabs avatar Jun 17 '20 01:06 eightfivelabs