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

chore: fix vite config to support firefox #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

numtel
Copy link

@numtel numtel commented Sep 28, 2024

Description

Problem*

Resolves #11

Summary*

This fixes the wasm loading on Firefox for me.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@numtel
Copy link
Author

numtel commented Sep 28, 2024

That second commit fixes this error when running npm run build:

x Build failed in 7.86s
error during build:
[vite:esbuild-transpile] Transform failed with 1 error:
assets/index-!~{003}~.js:2143:25: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

But then there's still the error about not having @aztec/bb.js since it's marked as external. It's 62 MB? How is this expected to be loaded in production?

TypeError: Failed to resolve module specifier '@aztec/bb.js'

@numtel
Copy link
Author

numtel commented Oct 15, 2024

With this latest commit, it fixes yarn build as well as yarn dev.

To do a similar header configuration on Cloudflare, setup a rule like this:
Screenshot 2024-10-14 at 20-54-11 Rules Transform Rules Modify Response Header circuitscan org Ben@latenightsketches com's Account Cloudflare

@critesjosh
Copy link
Collaborator

critesjosh commented Oct 20, 2024

Does this work for you? It's working for me on Brave, but I see this with yarn dev on Firefox.

image

It's working with yarn build and yarn preview on firefox.

@numtel
Copy link
Author

numtel commented Oct 20, 2024

Just checked again, working for me with yarn dev. That's the error that occurs with those 2 COEP/COOP headers in Firefox. Can you console.log(req.headers) (in the middleware function) and check what your user agent is?

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 this pull request may close these issues.

Proof generation fails in Firefox
2 participants