-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pnpm module resolution errors (on Windows) #3937
Comments
Base on your log above, it seems the problem is that esbuild did not try to resolve symlinks created by pnpm on Windows. The correct log should be like: Searching for "chalk" in "node_modules" directories starting from "D:\\a\\esbuild-3937\\esbuild-3937"
Parsed package name "chalk" and package subpath "."
Checking for a package in the directory "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules\\chalk"
Read 9 entries for directory "D:\\a\\esbuild-3937\\esbuild-3937"
Read 5 entries for directory "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules"
+ Resolved symlink "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules\\chalk" to "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules\\.pnpm\\chalk@5.3.0\\node_modules\\chalk"
The file "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules\\chalk\\package.json" exists
Read 4 entries for directory "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules\\chalk"
Looking for "." in "exports" map in "D:\\a\\esbuild-3937\\esbuild-3937\\node_modules\\chalk\\package.json"
Checking path "" against target "./source/index.js"
Joined "" to "./source/index.js" to get "./source/index.js"
... The above log was generated from a windows machine on github actions. Maybe you are just using old versions of esbuild and pnpm? |
The file system on Windows has multiple roots (volume labels) while the file system on Unix has a single root (just It's possible that cross-volume paths are the problem here. If that's the case, the reproduction steps would require spreading your source code across multiple volumes, and a possible workaround could be to make sure your source code is all on the same volume. Or if that workaround doesn't work then that wasn't the problem. I'm sorry that I can't test this myself but I don't have easy access to a Windows machine. |
Appreciate the response on this - apologies for not getting back in a timely manner. I've written this off as Windows being a bit ... unique. I've tried the same stuff on Linux and it works fine. Assuming it's something strange with how my specific Windows machine was behaving. |
I'm seeing some issues resolving pnpm packages, specifically on Windows, via the Go API.
I'm not entirely sure it's the same issue as mentioned in #67, but I'm able to reproduce it from the example given there (https://github.com/timsuchanek/esbuild-pnpm).
Given the following Go code (where
C:/Users/callu/Desktop/esbuild-pnpm/index.js
is the cloned repo mentioned in #67):With the verbose output, I'm getting the following:
Something tells me this is a me-problem, although I've been able to replicate this in other contexts.
It works great if I just use an
npm install
- no issues whatsoever. With apnpm install
, I start seeing the above errors.This also seems to be Windows-specific. Works fine on macOS.
I've tried various tweaks to the
api.Build
config, but haven't managed to get it working consistently.The text was updated successfully, but these errors were encountered: