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

Puppeteer support, problem with require.resolve #874

Open
BCaspari opened this issue Feb 17, 2022 · 4 comments
Open

Puppeteer support, problem with require.resolve #874

BCaspari opened this issue Feb 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@BCaspari
Copy link

Using ncc with puppeteer@13.2.2 does not work. The exception thrown is:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type number (49654) at validateString (internal/validators.js:124:11) at dirname (path.js:645:5)

puppeteer@13.2.1 worked, the PR that broke it is puppeteer/puppeteer#8003

The problem is the following line in the puppeteer code
const puppeteerRootDirectory = sync( dirname(require.resolve('./initialize-node')) );
which is transformed into
const puppeteerRootDirectory = (0, pkg_dir_1.sync)((0, path_1.dirname)(/*require.resolve*/(49654)));

I think require.resolve should not be replaced with number, but a string here?

@louisgv
Copy link

louisgv commented Feb 18, 2022

Yup, having the exact issue. I wonder where in ncc does the require statement transformed the path to a number?

@lyd0
Copy link

lyd0 commented Feb 18, 2022

I have this problem too. Hope it gets resolved

@louisgv
Copy link

louisgv commented Feb 18, 2022

Hmm... I downgraded to puppeteer@13.2.1 and the problem still exists.

@BCaspari
Copy link
Author

puppeteer@13.2.1 works for us... Which error do you get? Because the line I mentioned above was added in 13.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants