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] Yarn does not include main entrypoint if the package installed from GitHub and does not list entrypoint in files #976

Closed
1 task
larixer opened this issue Feb 20, 2020 · 3 comments
Labels
broken-repro The reproduction in this issue is broken bug Something isn't working

Comments

@larixer
Copy link
Member

larixer commented Feb 20, 2020

  • I'd be willing to implement a fix

Describe the bug

Yarn does not include main entrypoint if the package installed from GitHub and does not list entrypoint in files

To Reproduce

await packageJsonAndInstall({
  dependencies: {
    "pg-many-to-many": "github:hsanoyan/pg-many-to-many#e4af0e86927d62f3e6c9e8fdfdb8941fa08482fb"
  }
});

await expect(node(`require.resolve('pg-many-to-many')`)).resolves.not.toMatchObject({code: 'MODULE_NOT_FOUND'});
@larixer larixer added the bug Something isn't working label Feb 20, 2020
@yarnbot yarnbot added the reproducible This issue can be successfully reproduced label Feb 20, 2020
@yarnbot

This comment has been minimized.

@merceyz merceyz removed the reproducible This issue can be successfully reproduced label Jul 12, 2020
@yarnbot yarnbot added the broken-repro The reproduction in this issue is broken label Jul 12, 2020
@yarnbot
Copy link
Collaborator

yarnbot commented Jul 12, 2020

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: expect(received).resolves.not.toMatchObject(expected)

Matcher error: received value must be a non-null object

Received has type:  string
Received has value: "/tmp/tmp-27lQBEhAcYDBSI/.yarn/cache/pg-many-to-many-https-57cfeae214-4cab54e880.zip/node_modules/pg-many-to-many/index.js"
    at /github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-0ac41999f0.zip/node_modules/expect/build/index.js:205:73
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async module.exports (evalmachine.<anonymous>:8:1)
    at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:13
    at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:16)
    at async Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:12)
    at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-63f998598d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:38)
    at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
    at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
    at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-a57989414f.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

@merceyz
Copy link
Member

merceyz commented Jul 12, 2020

Yarn v2 now packs those files correctly since #1574
That project however will be packed with v1 since #1261 which also includes those files

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

No branches or pull requests

3 participants