-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
"../" being added to files when cwd has trailing slash on Node 23 #611
Comments
Some extra info I just though of that might be helpful to track this down: On Heroku, the exact same code from my project that ran correctly two days ago is breaking now. If I use Heroku's "rollback" feature, the old deployment package works correctly now, but when I use that same code and deploy again it break. My guess is that something in Heroku's infrastructure (libraries, packages, etc) changed and is conflicting now with something in glob. |
Here's the ticket with Heroku too: |
Can you provide an example that's just using glob, not a web app running on heroku or digital ocean? I'm not really sure how to know what the issue is. Just a standalone node program with expectations and actual values would be great. |
@isaacs I was just now about to narrow it down to an issue with Node 23.0.0. I can reproduce it locally and with any environment using v23 - it only showed up on Heroku because they must have rolled out support for that version recently for node projects with a 'node' engine requirement of 22 or greater (see below) while Digital Ocean is still using v22 for the same configuration.
Here's a more minimal repro: The fix for me, for now, is to update my projects to stick with Node 22 or below, but hopefully this will help folks prep glob for the future versions of Node. Thanks for your quick attention to this - your question forced me to dig a bit deeper and find the root issue. I appreciate all that you do for the Node community! |
This was a bug in node, it's been fixed in 23.1.0. Originally reported here |
Awesome, thanks @adnanel. |
Hi folks!
Just last night we started noticing an issue with glob on Heroku, where the 'files' array returned from glob has leading "../" characters, but only on Heroku (using Node 23) and only when the cwd has a trailing slash.
When using this:
The output looks like this:
Example output
It should look like this:
Reproduction info
You can see the code I used here to reproduce this:
https://github.com/avodah-dev/glob-slash-weirdness/blob/main/index.js
Here's how it looks when deployed to Heroku, with the trailing slash on rootPath:
https://glob-test-aace9e4820c6.herokuapp.com/?s=1
And using the "s" query param here's how it looks without the trailing slash:
https://glob-test-aace9e4820c6.herokuapp.com/?s=0
Digital Ocean example (working correctly)
For reference, it works correctly when I run it locally or on Digital Ocean (app platform) using Node 22:
https://sea-turtle-app-vg7i8.ondigitalocean.app/?s=1
Background
We stumbled into this issue last week on Heroku, initially using a 3rd-party buildpack for pnpm, but then confirmed to be an issue using the official NodeJS buildpack, and using npm today.
It was working great yesterday morning on Heroku, but then started breaking on new builds last night (10/22/2024).
I'll create a support ticket with Heroku in case it's an issue completely on their end, but I was hoping glob maintainers might know what's going on too.
Updated
The text was updated successfully, but these errors were encountered: