Skip to content

fix: edge bundling - tarball - add ./ prefix to tar entries to handle '@' prefixed filenames#6990

Merged
pieh merged 2 commits intonetlify:mainfrom
osmiumsilver:fix/tar-at-prefix-files
Mar 19, 2026
Merged

fix: edge bundling - tarball - add ./ prefix to tar entries to handle '@' prefixed filenames#6990
pieh merged 2 commits intonetlify:mainfrom
osmiumsilver:fix/tar-at-prefix-files

Conversation

@osmiumsilver
Copy link
Copy Markdown
Contributor

… '@' prefixed filenames

Fixes #6988

Fix: prefix each entry with './' so node-tar treats entries starting with '@' as explicit relative paths rather than archive-include directives.

This affects frameworks like Qwik that emit files named @qwik-city-not-found-paths.js, @qwik-city-plan.js, etc. into the edge functions output directory, causing builds to fail with:

ENOENT: no such file or directory, stat '/tmp/tmp-xxx/qwik-city-not-found-paths.js'

Update tarball.ts

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes #<replace_with_issue_number>


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

… '@' prefixed filenames

Fix: prefix each entry with './' so node-tar treats entries starting with '@' as explicit relative paths rather than archive-include directives.

This affects frameworks like Qwik that emit files named
@qwik-city-not-found-paths.js, @qwik-city-plan.js, etc. into the
edge functions output directory, causing builds to fail with:

ENOENT: no such file or directory, stat '/tmp/tmp-xxx/qwik-city-not-found-paths.js'

Update tarball.ts
@osmiumsilver osmiumsilver requested a review from a team as a code owner March 19, 2026 08:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ab1c8b79-2122-4b92-9529-a2382c4d006a

📥 Commits

Reviewing files that changed from the base of the PR and between 8b0e729 and 70e73c3.

📒 Files selected for processing (4)
  • packages/edge-bundler/node/bundler.test.ts
  • packages/edge-bundler/node/formats/tarball.ts
  • packages/edge-bundler/test/fixtures/imports_at_prefixed_files/netlify/edge-functions/@file_prefixed_with_the_at_symbol.ts
  • packages/edge-bundler/test/fixtures/imports_at_prefixed_files/netlify/edge-functions/func1.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an issue preventing edge functions with @ prefixed local imports from bundling correctly. Tarball entry formatting has been updated to support these import patterns.

Walkthrough

This pull request adds support for bundling edge functions with @ prefixed filenames. It modifies the tarball bundling logic to prefix tar entries with './', preventing node-tar from treating paths beginning with @ as special cases. The changes include an updated tarball creation function, a new test case verifying bundling and execution with @ prefixed imports, and corresponding test fixture files demonstrating the scenario.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Notes

The core fix is straightforward—adding a './' prefix to tar entry paths to ensure consistent handling of @ prefixed filenames. The test case provides clear coverage of the bundling and execution flow, and the fixture files are minimal helper implementations. The changes follow a consistent pattern across files and are primarily mechanical in nature.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and accurately describes the main change: adding a './' prefix to tar entries in edge bundling to handle '@' prefixed filenames.
Description check ✅ Passed The description explains the motivation (Qwik framework files with '@' prefix cause ENOENT errors), the fix (add './' prefix), and references the issue (#6988). However, the template checklist items are unchecked and not addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

@pieh pieh self-assigned this Mar 19, 2026
Copy link
Copy Markdown
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @osmiumsilver !

The tarball bundling failures should not cause fatal errors yet. Unfortunately it seems like you've hit case where internals of tar.create just crash/panic instead of throwing so our catches can't recover.

This does handle one of such crash cases, but I'll look to harden the setup if possible to hopefully avoid those failures impacting builds

@pieh pieh enabled auto-merge (squash) March 19, 2026 12:07
@pieh pieh merged commit 8537ffa into netlify:main Mar 19, 2026
55 of 58 checks passed
@pieh
Copy link
Copy Markdown
Contributor

pieh commented Mar 19, 2026

I'll get this released and updated in our build image ASAP and update once that is done

@pieh
Copy link
Copy Markdown
Contributor

pieh commented Mar 19, 2026

This should now be fully released to build image, I'm still to do that in CLI, but this should at least unblock CI builds

@osmiumsilver
Copy link
Copy Markdown
Contributor Author

@pieh Yes, i just tried redeploying and saw the new version of netlify Build shown in the logs, and now the build process goes smoothly. Thank you!

@pieh
Copy link
Copy Markdown
Contributor

pieh commented Mar 19, 2026

I also opened this PR upstream isaacs/node-tar#455 to hopefully prevent any potential other unhandled rejections causing fatal errors

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

Successfully merging this pull request may close these issues.

Netlify edge bundling fails with ENOENT when edge function directory contains files starting with '@'

2 participants