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

[Bug]: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: #7986

Closed
rmarkins-godaddy opened this issue Feb 9, 2022 · 6 comments
Closed

[Bug]: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: #7986

rmarkins-godaddy opened this issue Feb 9, 2022 · 6 comments
Labels

Comments

@rmarkins-godaddy
Copy link

Bug description

Steps to reproduce the problem:

  1. Install latest puppeteer-core
  2. attempt to path to ./lib/cjs/puppeteer/revisions

Puppeteer version

13.3.0

Node.js version

14.19.0

npm version

6.14.19

What operating system are you seeing the problem on?

Linux, macOS

Relevant log output

Full error


internal/modules/cjs/loader.js:456
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/cjs/puppeteer/revisions' is not defined by "exports" in /Users/rmarkins/dev/work/ghc/support/estimo/node_modules/puppeteer-core/package.json
    at new NodeError (internal/errors.js:322:7)
    at throwExportsNotFound (internal/modules/esm/resolve.js:332:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:565:3)
    at resolveExports (internal/modules/cjs/loader.js:450:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/Users/rmarkins/dev/work/ghc/support/estimo/scripts/find-chrome-binary.js:6:33) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
@rmarkins-godaddy
Copy link
Author

rmarkins-godaddy commented Feb 9, 2022

You can see an example of this for require in https://github.com/mbalabash/estimo/blob/master/scripts/find-chrome-binary.js#L6

This affects those using @size-limit/time package.

Subsequently is it possible just to add those to the exports path as it is useful information. Happy to open a PR w/ a fix if that's agreeable.

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 10, 2022

Ugh, sorry about that. We didn't realise that the internal modules were used directly. Let's see how we can fix it (happy to review a PR) but my first thought is: perhaps we should create an API for this use case?

@jan-molak
Copy link

jan-molak commented Feb 10, 2022

@OrKoN an API or a dedicated export would be appreciated, thanks! We're seeing the same issue with WebdriverIO (and other frameworks that rely on it, like Serenity/JS), which relies on Puppeteer to run local tests. Here are the puppeteer-core imports WebdriverIO uses.

Perhaps they could be added to exports?

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 10, 2022

we are going to export everything by default like it was (#7991 and #7992 should solve the issue)

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 10, 2022

Change of plans: we are going to revert the change and re-land it later in a backwards-compatible way.

@rmarkins-godaddy
Copy link
Author

closing as solved in 13.3.1. Thanks for the quick turnaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants