-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[HOLD for payment 2024-11-07] Unable to run storybook locally #51108
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
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 ( |
Triggered auto assignment to @trjExpensify ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Unable to run storybook locally What is the root cause of that problem?The “cannot access before initialization” error occurs when you try to use a variable before it has been initialized. What changes do you think we should make in order to solve the problem?We should declare and initialize the variable before we use it.
What alternative solutions did you explore? (Optional)N/A Contributor detailsYour Expensify account email: [email protected] |
📣 @Anaslancer! 📣
|
@trjExpensify, @ishpaul777 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
i'll review proposals soon |
Thanks for your proposal @Anaslancer, But I dont think your proposal identifies the root cause of the problem correctly, As I understand, it seems to be case of circular depency in importing of module
|
Thank you, @ishpaul777
So at the moment there is no error, because |
we need to mock the used componenets from realReactNavigation, i am not sure if this is a best way to do this, open to more ideas... diff --git a/__mocks__/@react-navigation/native/index.ts b/__mocks__/@react-navigation/native/index.ts
index 5bcafdc1856..1a56174209e 100644
--- a/__mocks__/@react-navigation/native/index.ts
+++ b/__mocks__/@react-navigation/native/index.ts
@@ -16,9 +16,11 @@ const {triggerTransitionEnd, addListener} = isJestEnv
addListener: () => {},
};
+const realOrMockedUseNavigation = isJestEnv ? realReactNavigation.useNavigation : {};
+
const useNavigation = () => ({
- ...realReactNavigation.useNavigation,
- navigate: jest.fn(),
+ ...realOrMockedUseNavigation,
+ navigate: isJestEnv ? jest.fn() : () => {},
getState: () => ({
routes: [],
}),
@@ -30,17 +32,17 @@ type NativeNavigationMock = typeof ReactNavigation & {
};
export * from '@react-navigation/core';
-const Link = realReactNavigation.Link;
-const LinkingContext = realReactNavigation.LinkingContext;
-const NavigationContainer = realReactNavigation.NavigationContainer;
-const ServerContainer = realReactNavigation.ServerContainer;
-const DarkTheme = realReactNavigation.DarkTheme;
-const DefaultTheme = realReactNavigation.DefaultTheme;
-const ThemeProvider = realReactNavigation.ThemeProvider;
-const useLinkBuilder = realReactNavigation.useLinkBuilder;
-const useLinkProps = realReactNavigation.useLinkProps;
-const useLinkTo = realReactNavigation.useLinkTo;
-const useScrollToTop = realReactNavigation.useScrollToTop;
+const Link = isJestEnv ? realReactNavigation.Link : () => null;
+const LinkingContext = isJestEnv ? realReactNavigation.LinkingContext : () => null;
+const NavigationContainer = isJestEnv ? realReactNavigation.NavigationContainer : () => null;
+const ServerContainer = isJestEnv ? realReactNavigation.ServerContainer : () => null;
+const DarkTheme = isJestEnv ? realReactNavigation.DarkTheme : {};
+const DefaultTheme = isJestEnv ? realReactNavigation.DefaultTheme : {};
+const ThemeProvider = isJestEnv ? realReactNavigation.ThemeProvider : () => null;
+const useLinkBuilder = isJestEnv ? realReactNavigation.useLinkBuilder : () => () => '';
+const useLinkProps = isJestEnv ? realReactNavigation.useLinkProps : () => ({}); |
@ishpaul777 I think it's best solution and it's similar like my above proposal. |
ok lets go with this solution #51108 (comment), lets assign @Anaslancer for PR 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Not really sure where to put this, but I guess being dev related we can put it in #quality. |
LGTM, feel free to create the PR @Anaslancer. |
Yep, PR has merged. Once it goes to prod, the 7-day regression period will start. Then payment will be made 👍 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.55-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-11-07. 🎊 For reference, here are some details about the assignees on this issue:
|
@ishpaul777 @trjExpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Checklist time! |
@trjExpensify When can we get the offer? |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
|
Payment summary as follows:
@Anaslancer can you link your Upwork profile, please? @ishpaul777, offer sent. |
Here is my link. Thank you, @trjExpensify |
Yes, it was me and deleted all test message. |
There is any way to test on public room? |
Thank you for your offer and accepted :) |
Thanks for confirming! Please don't use any of the EXFY owned public rooms for testing. They include real customers and investors.
You can create your own, but feel free to use this testing one as well: https://staging.new.expensify.com/r/2091104345528462 |
Paid, @Anaslancer. @ishpaul777 waiting on you to accept your offer now as well. |
@ishpaul777 bump! |
I just landed 🛬 in my home city was OOO past few days will be catching up on overdue things soon, Thanks for bump and sorry for delay |
I have accepted the offfer 🙇 |
Paid, closing! |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation: https://expensify.slack.com/archives/C02NK2DQWUX/p1727459623902909
Action Performed:
npm run storybook
Expected Result:
storybook should have opened without any issues
Actual Result:
Bunch of errors locally

Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
cc @ishpaul777
Issue Owner
Current Issue Owner: @trjExpensifyThe text was updated successfully, but these errors were encountered: