-
Notifications
You must be signed in to change notification settings - Fork 135
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
fix: undefined is not a function #795
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this suggestion, let's also add a
Log.warn
in here or at least aconsole.warn
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log please, adding conosle is useless as we don't have access to people's consoles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I tried adding the
Log.warn
orLog.info
but there were no logs in Expensify Web App console. There's this line inLog.jsx
inexpensify-common
which haswindow.DEBUG
:expensify-common/lib/Log.jsx
Line 38 in 42663c3
This
window.DEBUG
is undefined in the web app console when printed fromnode_modules/expensify-common/Log.js
.In Expensify codebase, we have explicitly marked
isDebug: true
here.When I set
isDebug: true
inexpensify-common/Log.jsx
, I start getting logs in Expensify Web App as well.Does anyone know if there's something I am missing with
window.DEBUG
while testing?Once the above succeeds, I plan to do something like below in the App so we have logs in crashlytics as well, this is just an example:
Let me know what you think of it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both
Log.warn
andLog.info
should log in the console too... do you have all log levels enabled in the JS console?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iwiznia Yes I do have this enabled.
The issue is that
window.DEBUG
isundefined
and as a result of whichisDebug
is set tofalse
and we don't get any logs. Below is the diff fromnode_modules/expensify-common
:See diff
When I set
isDebug: true
directly innode_modules/expensify-common/dist/Log.js
, I start to get logs. Below is the update:Log is visible in the console when
isDebug: true
:I don't have any context on
window.DEBUG
, so it will be great if someone can share details on it and why it can beundefined
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@francoisl So using
Log.alert()
appears to not be that helpful because it lacks the symbolication for the stack trace. I have recorded this by callinggetExtension
with numeric data inApp.tsx
while setting webpack toproduction
mode inwebpack.dev.ts
.Do you know it will show appropriate function names when used in actual prod?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that stack trace useful? It says webpack-internal in all of them....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's my question as well. It seems not useful, so we can use
Log.warn
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok I see, it doesn't look useful indeed. Sounds good for
Log.warn
then.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that it won't make it easier for us to find where this is being called wrong.... but we'll see.