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

pnp: esbuild@0.15.2 unable to resolve range dependencies #2464

Closed
bryanjtc opened this issue Aug 13, 2022 · 6 comments
Closed

pnp: esbuild@0.15.2 unable to resolve range dependencies #2464

bryanjtc opened this issue Aug 13, 2022 · 6 comments

Comments

@bryanjtc
Copy link

bryanjtc commented Aug 13, 2022

D3 packages use ranges in their dependencies. Example: https://github.com/d3/d3-scale/blob/main/package.json
When I use this d3-scale, yarn installs the dependencies and sets the latest version in that range as the resolution.
One of the dependencies of d3-scale is d3-time.
Yarn.lock:

"d3-time@npm:2.1.1 - 3":
  version: 3.0.0
  resolution: "d3-time@npm:3.0.0"
  dependencies:
    d3-array: 2 - 3
  checksum: 01646568ef01682550b7ee9f32394e4eb116a29515564861958871ed8de8fff02a25cd50dd8c4413921e6d9ecb8c8ce39be3266f655c8c18599fe58bcb253d60
  languageName: node
  linkType: hard

Esbuild can't resolve d3-time
image

@arcanis
Copy link

arcanis commented Aug 13, 2022

Do you have a clear reproduction? Esbuild doesn't differentiate between ranges, so this can't be the problem.

@bryanjtc
Copy link
Author

bryanjtc commented Aug 13, 2022

Link to the repo I made for a quick reproduction:
https://github.com/bryanjtc/test-d3-esbuild-yarn-pnp
Just run yarn tsup to see the errors with esbuild

@evanw
Copy link
Owner

evanw commented Aug 13, 2022

I get this when I run that:

$ git clone https://github.com/bryanjtc/test-d3-esbuild-yarn-pnp
$ cd test-d3-esbuild-yarn-pnp
$ yarn
$ yarn tsup
CLI Building entry: src/test.tsx
CLI Using tsconfig: tsconfig.json
CLI tsup v6.2.2
CLI Using tsup config: /home/evan/foo/test-d3-esbuild-yarn-pnp/tsup.config.js
CLI Target: node14
CLI Cleaning output folder
ESM Build start
CJS Build start
ESM dist/test.mjs 222.13 KB
ESM ⚡️ Build success in 641ms
CJS dist/test.cjs 222.46 KB
CJS ⚡️ Build success in 675ms
DTS Build start
DTS ⚡️ Build success in 3266ms
DTS dist/test.d.ts 589.00 B

There are no errors. What's the difference between what I'm doing and what you're doing?

@bryanjtc
Copy link
Author

Hmm, the only difference can be the node version and os. I'm using node 16.16.0 in windows 11.

@bryanjtc
Copy link
Author

Here is a more detailed output of the errors

Error: Build failed with 21 errors:
.yarn/cache/d3-array-npm-3.2.0-c3a38fe288-e236f6670b.zip/node_modules/d3-array/src/difference.js:1:24: ERROR: Could not resolve "internmap"
.yarn/cache/d3-array-npm-3.2.0-c3a38fe288-e236f6670b.zip/node_modules/d3-array/src/disjoint.js:1:24: ERROR: Could not resolve "internmap"
.yarn/cache/d3-array-npm-3.2.0-c3a38fe288-e236f6670b.zip/node_modules/d3-array/src/group.js:1:24: ERROR: Could not resolve "internmap"
.yarn/cache/d3-array-npm-3.2.0-c3a38fe288-e236f6670b.zip/node_modules/d3-array/src/index.js:57:35: ERROR: Could not resolve "internmap"
.yarn/cache/d3-array-npm-3.2.0-c3a38fe288-e236f6670b.zip/node_modules/d3-array/src/intersection.js:1:24: ERROR: Could not resolve "internmap"
...
    at failureErrorWithLog (C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:1624:15)
    at C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:1266:28
    at runOnEndCallbacks (C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:1046:63)
    at buildResponseToResult (C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:1264:7)
    at C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:1377:14
    at C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:678:9
    at handleIncomingPacket (C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:775:9)
    at Socket.readFromStdout (C:\Projects\test-d3-esbuild-yarn-pnp\.yarn\unplugged\esbuild-npm-0.15.2-e8a5300715\node_modules\esbuild\lib\main.js:644:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)

@evanw
Copy link
Owner

evanw commented Aug 13, 2022

Ah. It's a Windows-specific issue. Closing as a duplicate of #2462.

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2022
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