Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webkitRequestFileSystem and brotli_wasm_bg.wasm problem #125

Closed
szanuje opened this issue Apr 11, 2024 · 4 comments · Fixed by #144
Closed

webkitRequestFileSystem and brotli_wasm_bg.wasm problem #125

szanuje opened this issue Apr 11, 2024 · 4 comments · Fixed by #144
Assignees

Comments

@szanuje
Copy link

szanuje commented Apr 11, 2024

Thanks for reporting an issue!

Steps to reproduce

Add package to NextJS 14 project

Expected behaviour

Package imported correctly

Actual behaviour

Package is throwing error on NextJS build

Any logs, error output, etc?

Error is either:

Error: ENOENT: no such file or directory, open '/Users/<projectPath>/.next/server/chunks/brotli_wasm_bg.wasm'

or

 Collecting page data  ...TypeError: Cannot read properties of undefined (reading 'webkitRequestFileSystem')

depending on which import statement I use:

import parquetjs from "@dsnp/parquetjs";
import parquetjs from "@dsnp/parquetjs/dist/browser/parquet.esm";

Any other comments?

...

@wilwade
Copy link
Member

wilwade commented Apr 11, 2024

@szanuje Which version of webpack are you using? We've had a few issues with correctly handling webpack that might be related:

@JasonYeMSFT
Copy link

JasonYeMSFT commented Apr 12, 2024

'brotli-wasm' requires the wasm binary in a way that is very unfriendly to web bundlers.

const path = require('path').join(__dirname, 'brotli_wasm_bg.wasm');
const bytes = require('fs').readFileSync(path);

The dynamic fs read prevents the bundler from bundling the wasm, although we implemented a custom wasm loader.
The root cause seems to be this rustwasm/wasm-pack#831

@wilwade
Copy link
Member

wilwade commented Sep 11, 2024

Should be fixed in https://github.com/LibertyDSNP/parquetjs/releases/tag/v1.8.2

Please reopen if it does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants