-
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
esbuild tries to read ".." #2261
Comments
This is because esbuild needs to know package.json and tsconfig.json to resolve files and adjust behaviors. For example, package.json#imports and tsconfig#path can add extra resolve rules, package.json#type can change cjs interop behavior to node or babel. |
If you want to just read that file, you can use the transform API instead: https://esbuild.github.io/api/#transform-api. This means using |
Thanks for the quick reply! I should have clarified, I do have both a |
The reason that the parent directories are traversed ahead of time is because esbuild caches parent directory lookups for speed. You can read more about that in this thread: #938. Thank you very much for providing an easy way to reproduce the problem. I have already fixed an issue like yours in the past here: #942. But that case raised |
Thanks for the fix! |
I'm running
esbuild
with restricted access on macOS, whereesbuild
does not have access to anything outside of the current directory. Runningesbuild
then crashes because it tries to read the parent directory, even though it's only supposed to readapp.jsx
:where the sandbox profile is:
The text was updated successfully, but these errors were encountered: