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

Fixing problem with NCC #268

Closed
wants to merge 2 commits into from

Conversation

itsdarrylnorris
Copy link
Contributor

@itsdarrylnorris itsdarrylnorris commented Jul 29, 2020

Problem:

I am having an issue compiling a project using puppeteer-extra-plugin-stealth with NCC.

After some investigation, it looks like the problem it's related to a sub-dependency of the package merge-deep. I created a PR to fix this particular problem in the merge-deep jonschlinkert/merge-deep#14. However, that project does not look like it has been active for the last two years, and I wonder if my PR will even get merge.

Here is the NCC issue explaining the problem: vercel/ncc#500

@itsdarrylnorris itsdarrylnorris added the work-in-progress This is currently being worked on label Jul 29, 2020
@jozsi jozsi self-requested a review July 29, 2020 21:23
Copy link
Contributor

@jozsi jozsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This offers better consistency, both packages were being used previously (one occurences of merge-deep and two of deepmerge). Luckily, there is a test for the change you've done.

Please take a look at my question(s) addressed and clean up - if neccessary.

@@ -64,7 +64,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"merge-deep": "^3.0.2",
"deepmerge": "^4.2.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this dependency needed at all for the recaptcha plugin? I don't see any reference to it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being used on line 77 to merge the passed opts with the defaults

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @jozsi pointed out, this is not being used on the recaptcha plugin, therefore the dependency can most likely be removed.

packages/puppeteer-extra-plugin/package.json Show resolved Hide resolved
@itsdarrylnorris
Copy link
Contributor Author

After doing some testing with deepmerge, and puppeteer-extra I found out an issue with deepmerge that it's probably a blocker to use deepmerge, because it does not work with Set and we are using set here

const availableEvasions = new Set([

I created an issue in deepmerge about this: TehShrike/deepmerge#202

@itsdarrylnorris itsdarrylnorris changed the title Using deepmerge over merge-deep Fixing problem with NCC Jul 31, 2020
@itsdarrylnorris
Copy link
Contributor Author

I tried to use object-merge-advanced, but I ran into the same issue as merge-deep.

Any thoughts on how to move forward?

One possible alternative is to use this fork, which I made to merge-deep and it fixes the issue with NCC.

Thoughts?

@berstend
Copy link
Owner

What's the latest on this, is there a drop in replacement that works with Sets a well?
I'm creating a new base plugin (to support the new Playwright + Puppeteer rewrite) so now would be a good time to change that stuff. 😄

@berstend
Copy link
Owner

The author responded and mentioned using isPlainObject, I did some quick testing on runkit and think this is fixed?

image

@itsdarrylnorris
Copy link
Contributor Author

@berstend I think using deepmerge with isPlainObject it's the way to go. If I am not wrong I ran into other issue with it, but this is unrelated to puppeteer-extra.

Do you want me to make update to this PR to using deepmerge with isPlainObject? Or are you going to include this as part new plugin re-write?

@berstend
Copy link
Owner

@itsdarrylnorris apologies for the "slight" delay on this 😄 This will be fixed in #303, with this commit.

@berstend berstend closed this Nov 24, 2020
@berstend berstend deleted the puppeteer-extra/changing-to-deepmerge branch November 24, 2020 14:00
@itsdarrylnorris
Copy link
Contributor Author

@berstend No worries, I stopped using NCC it causes too many issues. Thanks for the #303 hard work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress This is currently being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants