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

[Defect] Already passed to createRoot() #980

Closed
ALuhning opened this issue Oct 21, 2023 · 2 comments · Fixed by #982
Closed

[Defect] Already passed to createRoot() #980

ALuhning opened this issue Oct 21, 2023 · 2 comments · Fixed by #982
Assignees
Labels
bug Something isn't working Emerging Tech Emerging Tech flying formation at Pagoda

Comments

@ALuhning
Copy link

Describe the bug

Getting following error in the console:

image

Seems to be coming from this code in our vmInitializer.js file of a BOS gateway template:

useEffect(() => { if (!near) { return; } near.selector.then((selector: any) => { setWalletModal(setupModal(selector, { contractId: near.config.contractName })); }); }, [near]);

See there is a similar closed issue.

Is there a way to get rid of this error?

@ALuhning ALuhning added bug Something isn't working Emerging Tech Emerging Tech flying formation at Pagoda Near BOS labels Oct 21, 2023
@ALuhning ALuhning changed the title [Defect] [Defect] Already passed to createRoot() Oct 21, 2023
@kujtimprenkuSQA kujtimprenkuSQA self-assigned this Oct 23, 2023
@kujtimprenkuSQA
Copy link
Contributor

Hi, @ALuhning thank you for raising this issue.

You're right the "warning/error" is coming from our setupModal function, apparently what's happening is that createRoot gets triggered every time setupModal is invoked in a dApp, this can happen because of some re-rendering of the component/context where setupModal is placed or on hot-reload during development.

Is there a way to get rid of this error?

Yes, it's possible to get rid of it.

From the next release, you can expect not to see this warning.

@kujtimprenkuSQA
Copy link
Contributor

Closing this issue because the fix was included in today's release v8.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Emerging Tech Emerging Tech flying formation at Pagoda
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants