-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix fastfile build errors #3
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
module.exports = { | ||
transpilePackages: ["@repo/ui"], | ||
webpack: (config, { isServer }) => { | ||
if (!isServer) { | ||
config.resolve.fallback = { | ||
fs: false | ||
}; | ||
config.resolve.alias = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document what this is required for? Maybe a comment here would be a good place to document the underlying issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comments
The linear issue to track this: https://linear.app/0xparc-pcd/issue/0XP-986/avoid-polyfill-issues-from-fastfile |
"@pcd/gpc" has dependency "@pcd/gpcircuits" which in turn depends on fastfile.
"fastfile" uses node modules "fs", "constants" and global "process" (process.browser).
We need to polyfill these in order for it to work in browser.
Otherwise, here is the build error I'm getting when running "yarn build"
This PR (see next.config.js) shows how to fix it in Next.js (uses webpack 5).
snark.js uses rollup, and here is how it does the polyfill.
zupass repo uses esbuild, and it uses the the plugin from "@esbuild-plugins/node-modules-polyfill" to do the polyfill.