Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

web-bundle: remote plugin imports are found by regex, so a computed import() is missed

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
frontend

Research direction

Start in apps/web-bundle/src/loader.js, where SPEC_RE finds imports and rewrites relative ones to blob URLs, then compare with apps/cli/remote-loader.js, whose header explains why resolving as the module system requests avoids the regex's failure modes. Reproduce a computed import(variable) of a sibling file in the browser and an import text inside a string or comment. Done means the browser loads both cases as Node does, but the fix needs a design choice between a real parse with sucrase and a service worker, so confirm the approach with the maintainer first.

Written by the indexing model from the issue text.

Description

bug

What happens

In the browser, a remote plugin's computed dynamic import (import(variable)) of one of its own files fails, and an import inside a string, comment or template literal can be rewritten. The same plugin works on Node.

Why

apps/web-bundle/src/loader.js finds imports with a regex (SPEC_RE) and rewrites the relative ones to blob URLs before the module runs. A computed specifier is invisible to it and is left to resolve against the module's blob: URL, which cannot resolve a relative reference. The regex also cannot tell an import from the same text inside a string or comment.

Node stopped predicting the graph this way: apps/cli/remote-loader.js resolves each import as the module system actually requests it, and its header gives the regex scan's failure modes as the reason.

Notes toward a fix

The browser has no resolve hook for blob modules, so the options are a real parse (sucrase is already loaded for type stripping and can give import positions) plus a runtime helper for computed specifiers, or a service worker serving the plugin under its real URL so the browser resolves natively. The second would also fix root-relative imports and import.meta.url, at the cost of the in-memory, no-service-worker design.

Found while reviewing #93.

Dominant language
TypeScript
Stars
5
Forks
2
Avg merge
1d 2h
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from MatAtBread/matbot

All issues in MatAtBread/matbot

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.