Skip to content

Fix npm package caching failure for Zod#7

Open
jsfour wants to merge 1 commit intomainfrom
claude/fix-npm-caching-zod-VISFe
Open

Fix npm package caching failure for Zod#7
jsfour wants to merge 1 commit intomainfrom
claude/fix-npm-caching-zod-VISFe

Conversation

@jsfour
Copy link
Member

@jsfour jsfour commented Jan 5, 2026

The issue was that npm packages used in user code (via npm: specifiers) weren't being cached during setup, causing "read-only file system" errors at execution time when Deno tried to download and cache them.

Changes:

  • Add cacheMainModule() function that runs deno cache on the main module during setup, resolving all imports including npm: specifiers
  • Remove --node-modules-dir flag from installDependencies() as it's not needed for npm: specifier support and may cause caching issues
  • Main module caching runs after explicit dependency installation and ensures all transitive dependencies are available at execution time

The issue was that npm packages used in user code (via npm: specifiers)
weren't being cached during setup, causing "read-only file system" errors
at execution time when Deno tried to download and cache them.

Changes:
- Add cacheMainModule() function that runs `deno cache` on the main module
  during setup, resolving all imports including npm: specifiers
- Remove --node-modules-dir flag from installDependencies() as it's not
  needed for npm: specifier support and may cause caching issues
- Main module caching runs after explicit dependency installation and
  ensures all transitive dependencies are available at execution time
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.

2 participants