Skip to content

[render preview] Fix coding loader path resolution#33

Open
Sup-ri-tha wants to merge 1 commit intomainfrom
fix/coding-loader-path
Open

[render preview] Fix coding loader path resolution#33
Sup-ri-tha wants to merge 1 commit intomainfrom
fix/coding-loader-path

Conversation

@Sup-ri-tha
Copy link
Copy Markdown
Collaborator

  • Replace process.cwd() with path resolution using __dirname

  • Align coding loader with quiz loader approach

  • Fix TOPIC_NOT_FOUND issue in production

  • Coding problems load correctly

  • No path-related errors in logs

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-lore Ready Ready Preview, Comment Apr 3, 2026 10:26pm

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes production path resolution for coding problem JSON loading by resolving the coding/ directory relative to the loader module location (ESM-compatible), matching the existing quiz loader approach and preventing TOPIC_NOT_FOUND caused by varying working directories.

Changes:

  • Replace process.cwd()-based root resolution with import.meta.url + fileURLToPath derived __dirname.
  • Resolve CODING_ROOT using path.resolve(__dirname, "../../coding") for stable location-based behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants