Skip to content

[BUG] Error occurs during cache population if path contains special characters like $ #638

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

Closed
minibox24 opened this issue May 5, 2025 · 0 comments · Fixed by #640
Closed
Assignees
Labels
bug Something isn't working triage

Comments

@minibox24
Copy link

Describe the bug

When there is a $ character in a file name within the path, the console seems to interpret it as a variable, causing that part of the path to disappear. As a result, Wrangler cannot find the file and an error occurs during cache upload. After modifying the code to use \\$ instead, the upload works correctly, which suggests that path normalization is necessary.

runWrangler args

[
  'r2 object put',
  '"...../incremental-cache/bGh5dxvb8vI7xaEP_Tf9u/6323318b427b96286ced6f5c2e85a45ba793a5166eb8d3f6d511c7e0326e0c02.cache"',
  '--file "...../.open-next/cache/bGh5dxvb8vI7xaEP_Tf9u/test.segments/$KHBhZ2VzKQ.10910087de24bfcabe854fda62b5023a61fe531705043b9979fdf00f12c4c0ec.segment.cache"'
]

wrangler r2 upload error

[ERROR] ENOENT: no such file or directory, open '...../.open-next/cache/bGh5dxvb8vI7xaEP_Tf9u/test.segments/.10910087de24bfcabe854fda62b5023a61fe531705043b9979fdf00f12c4c0ec.segment.cache'

Steps to reproduce

opennextjs-cloudflare deploy

Expected behavior

.

@opennextjs/cloudflare version

1.0.0-beta.4

Wrangler version

4.14.1

next info output

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024
  Available memory (MB): 15818
  Available CPU cores: 12
Binaries:
  Node: 20.18.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 10.6.1
Relevant Packages:
  next: 15.1.7 // There is a newer version (15.3.1) available, upgrade recommended! 
  eslint-config-next: 15.1.7
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A
 ⚠ There is a newer version (15.3.1) available, upgrade recommended! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Development

Successfully merging a pull request may close this issue.

2 participants