preactjs / preactjs/vite-prerender-plugin

Can't resolve source module for error code frame within monorepo

Open
#42 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
66
Forks
9
PR merge metrics
No merged PRs in 30d

Description

https://github.com/preactjs/vite-prerender-plugin/blob/master/src/plugins/prerender-plugin.js#L403

The line where it's removing an arbitrary amount of "../" doesn't work in a monorepo, because anything in my monorepo's root node_modules becomes inaccessible. Not sure what the fix is, I'm assuming removing the "../" is fixing some other issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/plugins/prerender-plugin.js line 403 and inspect how the error code frame resolves source modules and removes parent-directory segments. Reproduce the failure with a monorepo dependency in the root node_modules, then compare it with the case that motivated the existing path adjustment. Done means source modules resolve in monorepos without breaking the existing error code frame behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.