-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Bug report
Describe the bug
Trying to use sql.js
in a nextjs project throws an error, while trying to initialize the module.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
npx create-next-app next-sql.js
cd next-sql.js/
npm i sql.js
- Inside
pages/index.js
:
import initSQL from "sql.js";
const Page = () => {
console.log(initSQL);
console.log(initSQL());
initSQL().then(SQL => {
console.log(SQL);
const db = new SQL.Database();
console.log(db);
});
return null;
};
export default Page;
npm run dev
- See Error in Console
Expected behavior
Ability to import and use sql.js like in the example provided here.
Screenshots
Additional context
Also, without defining fs
in next.config.js
, sql-wasm.js
throws a module not found error about the fs
module.
My guess is that I should change my config settings to support wasm
, but I'm not really familiar with that.
Issue in next.js repo.
ctrngk
Metadata
Metadata
Assignees
Labels
No labels