Repository navigation
Require cycle: node_modules/core-js/internals/microtask.js warning #31969
Description
Activity
- addedNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
on Aug 6, 2021 ⚠️ Missing Reproducible Example ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. Thanks for the issue @KrisLau would need more information then just the error message. Could you provide a repo that demonstrates the error from a fresh template.
@safaiyeh Sorry it's taken me so long to get back to you! So I figured out the part that's causing the error but I'm unsure how to resolve it as it was working prior. It's being caused by the
AppRegistry.registerComponent(appName, () => Root);when I change theRoottoApp, it works fine but I would like to have the dev meu toggle visible still. Also, another weird thing to note is that my code as-is works well in iOS with only the require cycle error (as opposed to on android where i also get anInvariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)error)
I had followed the instructions from this blog: https://spicyseashells.com/article/react-native-storybook to implement the dev menu toggle for storybook.My code (excluding import statements for brevity):
**// index.js** AppRegistry.registerComponent(appName, () => Root);**// Root.tsx** const Root = () => { const [storybookActive, setStorybookActive] = useState(false); const toggleStorybook = useCallback( () => setStorybookActive(active => !active), [], ); useEffect(() => { if (__DEV__) { // eslint-disable-next-line @typescript-eslint/no-var-requires const DevMenu = require('react-native-dev-menu'); DevMenu.addItem('Toggle Storybook', toggleStorybook); } }, [toggleStorybook]); return storybookActive ? <Storybook /> : <App />; };**// storybook/index.js** const StorybookUIRoot = getStorybookUI({ host: Platform.OS === 'android' ? '10.0.2.2' : '0.0.0.0', asyncStorage: AsyncStorage, }); AppRegistry.registerComponent(appName, () => StorybookUIRoot); export default StorybookUIRoot;Reacted by Denis Kniazhev- addedNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.and removed
on Aug 9, 2021 Any updates on this? When I set
inlineRequires = false, the app builds successfully but I'd like to keep inline require enabled if possibleReacted by Subramanya Chakravarthy, LeoTM, Antonio de Padua, deliotclarke40au, Artur, skuːl, Brandon Austin and AliI'm getting the same issue as @KrisLau. And it's also relative to Storybook.
Even the simple boolean-based export type creates troubles (in my case, react-hook-form stops working)
// App.tsx ... export default config.storybook.LOAD_STORYBOOK ? StorybookUI : AppThe only warning I'm getting is about the Require cycle
The unique working solution is to set
inlineRequires: falseinmetro.config.js.@safaiyeh Any ideas on what might be causing this?
Looks like this have not too much to do with RN itself and warning is properly thrown in that case.
This seems to be a problem with Storybook for ReactNative and it should be addressed with next version.
See more here: storybookjs/react-native#240This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
- addedStaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
on Mar 8, 2024 This issue was closed because it has been stalled for 7 days with no activity.
Description
Getting this error when I build my React Native app
React Native version:
Steps To Reproduce
I'm not sure what caused it but it is similar to this commenter and issue #31173. The solution provided in #31173 is to disable Hermes but I would like to leave Hermes enabled since it is supposed to provide performance improvements.
Expected Results
No error in Metro
Snack, code example, screenshot, or link to a repository: