Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

environmental variable to suppress duplicate atom key warning #2020

Conversation

brahn
Copy link

@brahn brahn commented Sep 20, 2022

This PR is an attempt to address #733 by introducing an environmental variable process.env.SUPPRESS_DUPLICATE_ATOM_KEY_WARNING that suppresses the duplicate atom key warning.

The first commit just adds tests for the current behavior, i.e. logging to console.error / console.warn, depending on the value of window.__DEV__. The second commit adds the new behavior and tests for the additional cases where this environmental variable is set.

Feedback and suggestions would be most welcome!

@facebook-github-bot
Copy link
Contributor

Hi @brahn!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 20, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot
Copy link
Contributor

@wd-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@brahn has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@wd-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@wd-fb
Copy link
Contributor

wd-fb commented Sep 22, 2022

Thanks so much for this! There were a few Meta internal tests failing (to do with console logging expectations), I may have to make some tweaks on the tests but hopefully we can get this merged/released soon

@brahn
Copy link
Author

brahn commented Sep 22, 2022

Thanks @wd-fb ! I appreciate the update, and please lmk if there's anything I can do to help with the internal tests.

@Syntarex
Copy link

Omg thank you so much. Now I can finally use recoil in my next.js apps. BIG LOVE! <3

@brahn
Copy link
Author

brahn commented Sep 28, 2022

Hi @wd-fb just checking back in, let me know if there's anything I can do to help!

@wd-fb
Copy link
Contributor

wd-fb commented Sep 29, 2022

Hi @wd-fb just checking back in, let me know if there's anything I can do to help!

Thanks for the patience, we will be doing a patch release soon. It will also include a runtime settable flag for other environments which don't use 'process' (Vite for example)

@brahn
Copy link
Author

brahn commented Sep 29, 2022

@wd-fb fantastic, thanks for the update!

@drarmstr
Copy link
Contributor

drarmstr commented Oct 6, 2022

Updated API with #2046

@drarmstr drarmstr closed this Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SSR][NextJS] Duplicate atom key during development and during production build in nextjs
5 participants