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

Remove console.log statement #1

Closed
abrkn opened this issue Dec 24, 2020 · 11 comments
Closed

Remove console.log statement #1

abrkn opened this issue Dec 24, 2020 · 11 comments

Comments

@abrkn
Copy link

abrkn commented Dec 24, 2020

It's not helpful

@favna
Copy link
Member

favna commented Dec 24, 2020

If you somehow actually run into the console.log in your code then you're using the dependency wrong. So there's no harm for the small Easter egg to be there.

Please give me an example where you ran into the console log.

@jorissteyn
Copy link

This happens build-time, I don't think I'm using it wrong - it works fine but the message will show during build:

image

@favna
Copy link
Member

favna commented Jan 4, 2021

This means that whatever dependency you're ignoring is still being accessed and the index.js file is being executed. I'll remove the line but I would advise you to look into the webpack output as it may be invalid in one way or another due to skip-dependency being accessed instead of the dependency it would otherwise access.

@favna favna closed this as completed in 05552e9 Jan 4, 2021
@favna
Copy link
Member

favna commented Jan 4, 2021

Version 1.1.0 has been published which removes the line. Update the version in the resolutions string to the following to start using it.

https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.0.tgz

@jorissteyn
Copy link

This means that whatever dependency you're ignoring is still being accessed and the index.js file is being executed.

I believe you're right and think I understand why we're seeing the message. I'm using this package (as others do too) to build image-webpack-loader without gifsicle. It will import the module, but not use it since it's excluded in the webpack config.

Thanks for the fast response!

@jorissteyn
Copy link

Hm, there is a, perhaps unintended, difference between the two versions:

1.1.0
image

1.0.2
image

Version 1.0.2 works fine, 1.1.0 does not (can't find module ...). This is how I include the package in package.json (the addition works, the removal doesn't):

     "throttled-resize": "^1.0.1"
   },
   "resolutions": {
-    "gifsicle": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.0.tgz"
+    "gifsicle": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.0.2.tgz"
   }
 }

@favna
Copy link
Member

favna commented Jan 4, 2021

And here I was hoping I could improve the package a bit... I'll have to look into this then. Is this repo where you're using gifsicle open source so I can use it to test @jorissteyn ?

@favna favna reopened this Jan 4, 2021
@jorissteyn
Copy link

Yeah see the comment in Klathmon/imagemin-webpack-plugin#113

@favna
Copy link
Member

favna commented Jan 8, 2021

@jorissteyn I tried to reproduce it but I couldn't get to give me any error. That said, I did publish v1.1.1 where I moved the index files out of src again. Could you check that version, and if it doesn't work, could you create a small repo with the issue so I can use that to fix the issue?

@jorissteyn
Copy link

Confirmed v1.1.1 works like a charm, thank you!

@favna
Copy link
Member

favna commented Jan 14, 2021

That's good to hear, then I'll close this issue.

@favna favna closed this as completed Jan 14, 2021
Ashoat added a commit to CommE2E/comm that referenced this issue Jan 9, 2023
Summary:
After the React Native 0.70 upgrade, I noticed a statement saying something like "wow you found the file, here's a cookie 🍪". I couldn't find that anywhere on GitHub or via `git grep`, so I ran `grep -R 🍪 .` in the root in the repo and found what was going on.

The source was the `@favware/skip-dependency` package. I found [this issue](favware/skip-dependency#1) on their GitHub, which revealed that the line got printed when the dependency being replaced by `@favware/skip-dependency` was included. It's there as a sort of canary to indicate that the replaced package is still being imported, and to warn of any possible issues that may result.

In our case, the import is occurring in `@react-navigation/devtools`, but since we're not using `useFlipper` from that package, nothing is done with the import, so we are safe.

To turn off the warning, I updated the package to a version that no longer printed the error, as advised in the linked GitHub issue above.

Test Plan: Confirm the cookie message was no longer getting printed in the React Native logs

Reviewers: tomek, bartek, atul

Reviewed By: tomek, bartek

Differential Revision: https://phab.comm.dev/D6194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants