-
-
Notifications
You must be signed in to change notification settings - Fork 861
🐛 [Bug report]: The main build fails when snap is enabled #783
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
Comments
@Sachin-chaurasiya tagging you here. @nirban256 this fails after including the web3 play. Could you please check if you can help with any clue or fix it? |
@atapas checking it |
@nirban256 I think I am getting a bit hang to it now. This seems to be an issue of passing something undefined and ether js is throwing this error due to that. Please refer: ethers-io/ethers.js#1234 As the snap actually crawls through the pages, it must have passed some undefined value to ether and resulted this error. Please see if this gives you any clue to fix in any corner. |
So what's the fix? We use react-snap to pre-render the ReactPlay web app. The react-snap uses a headless Chrome to crawl all available links in the app. In our case, each of the play links will lead to its main component. As the main component loads by the crawler, this component's default const onload = async () => {
const provider = new ethers.providers.Web3Provider(window.ethereum);
setProvider(provider);
const contract = new ethers.Contract(
ContractAddress,
artifact.abi
)
setContract(contract);
}
useEffect(() => {
onload();
}, []) The code in the That's when we run the snap as a post-build process, it fails with the error explained here: #783 (comment). As a fix, we handled the error with a try-catch. |
Uh oh!
There was an error while loading. Please reload this page.
Descrcibe the bug?
With a recent play got merged, the main build fails when the snap is enabled.
Here is the error:
The build works if the snap is disabled but we can not disable it as we will lose the meta information on plays and the image will not be shown when it is shared on the social media.
Steps to reproduce the bug?
Expected behavior
The build should pass with the snap build command.
Desktop (Please provide your system information)
NA
Mobile (Please provide your device information)
NA
Screenshot / Screenshare
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: