Skip to content

I am trying to use as client side node_module through ESM and get vite-plugin-pwa error cannot resolve fs. #616

Closed
@LeeRob97

Description

@LeeRob97

Here is the error when I run vite build

error during build:
[vite-plugin-pwa:build] [plugin vite-plugin-pwa:build] node_modules/sql.js/dist/sql-wasm.js: There was an error during the build:
  Failed to resolve entry for package "fs". The package may have incorrect main/module/exports specified in its package.json.

At the top of my file where I try to init the db I import as:

import initSqlJs from "sql.js";

I have removed the vite pwa plugin and get the error:

error during build:
[commonjs--resolver] Failed to resolve entry for package "fs". The package may have incorrect main/module/exports specified in its package.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions