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

Can't find variable: fs #1863

Closed
ianberdin opened this issue Dec 17, 2021 · 1 comment
Closed

Can't find variable: fs #1863

ianberdin opened this issue Dec 17, 2021 · 1 comment

Comments

@ianberdin
Copy link

Before an error occurs in the Safari worker, an error crashes in esbuild. But this is not related to safari, rather to error handling.

Error:
Can't find variable: fs

The problem in browser.js:

// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
"runtime.wasmWrite": (sp) => {
  sp >>>= 0;
  const fd = getInt64(sp + 8);
  const p = getInt64(sp + 16);
  const n = this.mem.getInt32(sp + 24, true);
  // Look here, there is no global variable fs, it should be global.fs.writeSync(...)
  fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
},
@ianberdin
Copy link
Author

ianberdin commented Dec 17, 2021

Moreover we can't even get resolve or catch from the a Promise. It just hangs. Same with #1860

try {
  await  esbuild.build(...) // it hangs here
} catch (err) {
   // Here isn't reachable
}
// Here isn't reachable

@evanw evanw closed this as completed in 8debc09 Feb 16, 2022
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

No branches or pull requests

1 participant