Derek Ellis
01/14/2022, 2:07 AMxxfast
01/14/2022, 2:08 AM"dependencies": {
...
"sql.js": "^1.5.0",
...
},
Derek Ellis
01/14/2022, 2:09 AMDerek Ellis
01/14/2022, 2:09 AMxxfast
01/14/2022, 2:13 AMxxfast
01/14/2022, 2:20 AMUncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -s ASSERTIONS=1 for more info.
at F (sql-wasm.js:106)
at sql-wasm.js:165
Derek Ellis
01/14/2022, 2:22 AMDerek Ellis
01/14/2022, 2:23 AMxxfast
01/14/2022, 2:23 AMsql-wasm.js:166 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
yeah, i assumed this could be why in the original thread herexxfast
01/14/2022, 2:24 AMxxfast
01/14/2022, 2:24 AMDerek Ellis
01/14/2022, 2:25 AMxxfast
01/14/2022, 2:26 AMxxfast
01/14/2022, 9:04 AMxxfast
01/14/2022, 9:04 AMcopy-webpack-plugin
required webpack >v5xxfast
01/14/2022, 9:05 AMnpm i copy-webpack-plugin@6
as mentioned herehfhbd
01/15/2022, 3:31 PMxxfast
01/16/2022, 10:31 PMreact-app-rewired
to override webpack configs from create-react-app
// config-overrides.js
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = function override(config, dev) {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [{from: "./node_modules/sql.js/dist/sql-wasm.wasm"}],
}),
)
return config;
}
xxfast
01/16/2022, 10:33 PMnpm-publish
, and serving from js project
val jsMain by getting {
dependencies {
implementation(npm(Npm.sqlJs, Npm.Versions.sqlJs))
}
}
hfhbd
01/17/2022, 12:24 AM