Closed
Description
I tried this to create new connection to sql.js by using the code below on index.ts
createConnection({
type: "sqljs",
location: "../node_modules/sql.js/dist/sql-wasm.wasm",
autoSave: true,
entities: [
"../entity/**/*.ts"
],
logging: ['query', 'schema'],
synchronize: true
}).then(async connection => {
// await insertScriptData(connection);
// const user = await MockUserToFavorite(connection);
// await insertNewsData(connection);
log.debug(connection)
app.listen(8080, () => {
log.info('Server is running on port 8080');
});
});
However, the error was thrown like the following:
(node:85901) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
TypeError: Failed to parse URL from /Users/sigridjin.eth/Documents/deliverble-backend/node_modules/sql.js/dist/sql-wasm.wasm
I already tried the following options but it was failed; the method of readFile does not expect two arguments.
const wasmBinary = await readFile(new URL("../node_modules/sql.js/dist/sql-wasm.wasm", import.meta.url));
const SQLJS = await initSql({
wasmBinary,
});
What should I do? Thanks for in advance.
Metadata
Metadata
Assignees
Labels
No labels