Skip to content

fix(section-1): corrects relative path in src/demos/section-1/001_providing-a-service-01.ts #2

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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: [email protected]
  • 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