Skip to content

Conversation

@olange
Copy link

@olange olange commented Jun 13, 2025

Minor change to allow running the first demo of section 1.

What?

src/demos/section-1/001_providing-a-service-01.ts raises a CacheMissError when trying to run it.

Why?

The lookup() method in FileSystemCache was attempting to read from src/demos/session-1/cache/${key}.
But the correct path is src/demos/section-1/cache/${key}.

Before

try: () => fs.readFile(`src/demos/session-1/cache/${key}`, "utf-8"),

After

try: () => fs.readFile(`src/demos/section-1/cache/${key}`, "utf-8"),

Testing

With this fix, the expected output is:

% pnpm exercise src/demos/section-1/001_providing-a-service-01.ts

in-memory-value1
file-value2

Previously, the output was:

[…]
in-memory-value1
CacheMissError: Failed to read file for cache key: "key2"

My environment

  • OS: macOS
  • Node.js version: v24.1.0
  • Package manager: pnpm@10.5.1
  • Command used: pnpm exercise src/demos/section-1/001_providing-a-service-01.ts

…ng-a-service-01.ts

fs.readFile(`src/demos/section-1/cache/${key}`) instead of `…/session-1/…`.
@olange olange changed the title fix(section-1): PunsterClient service fully qualified tag in exercise 001 fix(section-1): corrects relative path in src/demos/section-1/001_providing-a-service-01.ts Jun 16, 2025
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.

1 participant