Repository navigation
Description
Found in the v0.0.140 vs v0.0.159 corpus check for #1420 and #1422 (stored Product Hunt crawls, offline re-detect).
What happens
three.js loaded through an import map or an inline module import is not detected. v0.0.140 found it, but only by accident: on a page without attached script bodies it matched script URL patterns against the whole HTML. v0.0.150 rightly stopped doing that (it also dropped CSP, link and prose matches), and the real uses went with it.
32 sites lost threejs at that boundary. All 5 sampled are real uses, loaded in one of two ways:
- an import map:
<script type="importmap">{"imports":{"three":"https://cdn.jsdelivr.net/npm/three@<v>/build/three.module.js","three/addons/":"..."}}</script>(4 of 5; the CDN varies: jsdelivr, unpkg, cdnjs, or a self-hosted./vendor/three/build/three.module.js) - an inline module:
<script type="module">import * as THREE from 'https://cdn.jsdelivr.net/npm/three@<v>/build/three.module.js'; ...</script>(1 of 5)
Neither is a <script src>, so the script-url detectors never see the URL. The same gap probably affects every library that ships as an ES module from a CDN (for example vue, react or lit through esm.sh or jsdelivr +esm).
amended 2026-11-02: of the 5 sampled sites, 4 use an import map (0.1 to 0.2 KB) and 1 an inline module of about 465 KB. Import maps are covered by #1542; the large inline module is the same question as #1540 (inline scripts over 16 KB are not read).
Expected
A URL that a page actually loads as a module counts as a script URL for detection: an imports value in a type="importmap" script, and the specifier of a static import ... from '<url>' or import('<url>') in an inline type="module" script. A URL in prose, a CSP, a link or a JSON data block still does not count.
Acceptance Criteria
- A page whose import map maps
threeto athree.module.jsURL detectsthreejs(covered by fix(tech-detect): the URLs an import map maps to are script URLs #1539 #1542) - A page with an inline
<script type="module">that imports from athree.module.jsURL detectsthreejswhen the script is under 16 KB (already detected on main; amended 2026-11-02: the one sampled site of this form has a ~465 KB inline module, overINLINE_LOADER_MAX_CHARS, which is the large-inline design question in Tech detection: a loader inside an inline script over 16 KB is not read #1540, decided not now) - Bare specifiers and relative paths in an import map resolve against the page URL before matching
amended 2026-11-02: values are matched as written, the same as a relative<script src>is today, and are not resolved against the page URL:./vendor/three/build/three.module.js,../x.jsand/static/three.module.jscount as script URLs. Only http, https, protocol-relative values and paths starting with/,./or../are read; a bare name without/,./or../(for examplethree.module.js) is not read (a browser would reject it as a map value), and so are data:, javascript: and blob: values and any value with a quote, angle bracket, backtick, backslash, whitespace or control character, or over 2,048 characters. Keys (bare specifiers such asthree) are never read; only the string values ofimportsand of eachscopestable are. Checkable: a map with "three": "./vendor/three/build/three.module.js" detects threejs; a map whose key is a vendor URL and whose value is local does not. - The tech-detect: a Next.js flight script re-opens the prose, link and metadata false-positive classes for script-url signatures #1437 and Tech detection: script-url detectors stop seeing inline-loader URLs (Clarity snippet) once a page has script bodies attached #1430 negatives still hold: a vendor URL only in a CSP
<meta>, a<link>, JSON-LD, a JSON data script or prose is not detected - On the PH corpus re-detect,
threejssites rise with no new detections from prose (a sample of the gains is checked)
nik
Activity
fix(tech-detect): import map URLs: per map, page and byte caps; only …
fix(tech-detect): an import map inside a template is not read; scopes…
fix(tech-detect): import map URLs: per-map cap 256, bare and control/…
nc9 commentedon Nov 2, 2026
Amended criterion 3 (original text kept visible) to the behaviour the import-map fix in #1542 ships: map values are matched as written, not resolved against the page URL; only http(s), protocol-relative and
/,./,../paths are read, a bare name is not; keys are never read. Checked on the PR's final head:./vendor/three/build/three.module.js,/static/three.module.jsand a jsdelivr URL detect threejs;three.module.jsandthree/x.jsare not read. No box is ticked yet: the fix is in review and not on main.nik
fix(tech-detect): the URLs an import map maps to are script URLs #1539
fix(tech-detect): import map URLs: per map, page and byte caps; only …
fix(tech-detect): an import map inside a template is not read; scopes…
fix(tech-detect): import map URLs: per-map cap 256, bare and control/…
nc9 commentedon Nov 4, 2026
Acceptance check against main 7c31d5b. The import map fix shipped in v0.0.160 (c23c8e1, hardened by 8b97ba8, fab4d37 and 7aabe2b), all in v0.0.161.
threeto athree.module.jsURL detectsthreejspackages/tech-detect/tests/importmap-1539.test.ts"three.js through jsdelivr, unpkg, cdnjs and a self-hosted path" (also scopes, uppercase type, several maps)three.module.jsURL detectsthreejsimport())./,../,/, http(s) and protocol-relative are read; a bare name, keys, data:, javascript:, blob: and unsafe characters are not./vendor/three/build/three.module.jsand/static/js/three/three.module.js; "an import map's keys, a malformed map ..." covers a vendor URL as a key with a local value; "a bare name (no scheme, no leading slash) is rejected; a path with a slash is kept". I also checked by hand on main: key-only vendor URL gives nothreejs,"three": "three.module.js"gives none,./vendor/three/build/three.module.jsgivesthreejs.script-url-inline-1430.test.ts(11 pass),script-url-wrappers-1435.test.ts(11 pass),flight-script-narrow-1437.test.ts(58 pass);importmap-1539.test.ts"what is still not a script URL" covers a CSP meta, an anchor, JSON-LD, a JSON data script, a Next data script, speculation rules and prose.threejssites rise with no new detections from proseRan on main:
importmap-1539.test.ts(42 pass) and the three negative files above.One observation, not part of these criteria and the same on v0.0.159: a
<link>of any rel (evenrel="canonical") whose href is a vendor script URL still counts as a script URL for that vendor, because link hrefs are read as resources. Box 4 is ticked on the #1430 and #1437 tests, which cover anchors, meta text, JSON-LD and data blocks.Ticked 1 to 4; left open for 5.
nik
nc9 commentedon Nov 4, 2026
Re-check against main 8d22fa2. Criteria 1 to 3 stay ticked (
packages/tech-detect/tests/importmap-1539.test.ts: 42 pass, nothing inpackages/tech-detectchanged since the previous check). I have unticked criterion 4 and left 5 open.<link>, JSON-LD, a JSON data script or prose is not detectedscript-url-wrappers-1435.test.ts,script-url-inline-1430.test.ts,importmap-1539.test.ts"what is still not a script URL"). But the "link" in those tests is an anchor (<a href>), not a<link>element. Run on main withdetectTechnologies: a page whose only vendor reference is<link rel="canonical" href="https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js">detectsthreejs; so doesrel="modulepreload", while an anchor and prose with the same URL do not. An existing test asserts a<link rel="preload" href>counts as a loaded resource, so this is deliberate for preload-style rels but it is not true of every<link>. Same on v0.0.159, so not a regression of the import map change.threejssites rise, no new detections from proseTo close criterion 4: either amend it to say an anchor (not a
<link>) and keep the pins, or make<link>count only for resource rels (stylesheet, preload, modulepreload, prefetch, and so on) with a test that a canonical or alternate link does not. Criterion 5 needs the corpus run.nik
fix(tech-detect): a link counts as vendor evidence only with a loadin…
fix(tech-detect): link rel read with the current quote-aware attribut…
fix(tech-detect): a link's rel is read in whole tokens, not cut at 25…
fix(tech-detect): a link counts as vendor evidence only with a loadin…
fix(tech-detect): link rel read with the current quote-aware attribut…
fix(tech-detect): a link's rel is read in whole tokens, not cut at 25…
nc9 commentedon Nov 4, 2026
Acceptance check against main d7e9b44 (v0.0.167). Criteria 1 to 3 stay ticked.
<meta>, a<link>, JSON-LD, a JSON data script or prose is not detectedpackages/tech-detect/tests/link-rel-1539.test.tspins that canonical, alternate, author, license, help, next, prev, icon, manifest and a missing rel detect nothing (101 pass across this file and three others on main). But a<link>with a loading rel (stylesheet, preload, modulepreload, prefetch, prerender, preconnect, dns-prefetch) still counts as vendor evidence on purpose. The criterion says "a<link>" without that limit.threejssites rise, no new detections from proseGap on criterion 4: either amend it to "a
<link>whose rel does not load its resource (canonical, alternate, and the like)" and keep the pins, or decide that loading-rel links must not count (that would remove 14 of the 50 gains above). I recommend the amendment; it is the maintainer's call, so the box stays unticked.One observation outside the criteria: between v0.0.165 and the v0.0.167 tip the same corpus run shows 2 supabase pairs and 1 vue pair lost. The vue evidence is a link or prose (the intended change here). For the 2 supabase pairs the cause is unresolved: both were detected in v0.0.165 by the
tag-attrhref rule on a collected tag and are not in the v0.0.167 tip, with the same bundles attached. Worth a look by whoever owns the link-rel change.Ticked 5; left open for 4.
nik
fix(tech-detect): a preconnect or dns-prefetch to a supabase project …
fix(tech-detect): bundler resource lists read like an import map, sup…
fix(tech-detect): a preconnect or dns-prefetch to a supabase project …
fix(tech-detect): bundler resource lists read like an import map, sup…
nc9 commentedon Nov 5, 2026
Acceptance check against main 7e8416b (v0.0.169). Criteria 1 to 3 and 5 stay ticked. Criterion 4 stays unticked, and it needs a maintainer decision on its wording.
<meta>, a<link>, JSON-LD, a JSON data script or prose is not detected<link>that only describes or relates a URL:packages/tech-detect/tests/link-rel-1539.test.ts"canonical, alternate, author, license, help, next, prev, icon and manifest" and "a missing rel, an unquoted rel and a rel with other tokens around the describing one" assert nothing is detected (shipped in v0.0.166, 7a111f6, a8387a9, e046df1). Still true by design: a<link>with a loading rel (stylesheet,preload,modulepreload,prefetch,prerender,preconnect,dns-prefetch) counts as vendor evidence (same file, "stylesheet, preload, modulepreload, prefetch, prerender, preconnect and dns-prefetch ...";docs/cloud/technologies.mdxsays so). The criterion says "a<link>" without that limit, so it is not true as written.Proposed amendment for criterion 4 (maintainer's call, original text to stay visible):
With that wording criterion 4 is met on the evidence above, and the issue can close. The alternative (loading-rel links must not count either) would remove 14 of the 50 threejs gains checked under criterion 5, so I do not recommend it.
Follow-up on the link-rel change: the supabase pairs lost between v0.0.165 and v0.0.167 on the corpus slice were root-caused and fixed in v0.0.168.
<link rel="preconnect">ordns-prefetchto a bare supabase project origin is real use, and the detector asked for a/rest/v1-style path, so it missed it once alternate links stopped counting. d23f6bd added a bare-origin detector and 856dc70 made it match only when the origin is the wholehref(a list that only contains it does not count; analternate,canonicallink or an anchor does not). Pinned insupabase-preconnect-1539.test.ts(preconnect and dns-prefetch detect; "an alternate or canonical link to a bare origin", "an anchor to the bare origin" and "the origin must be the whole href" do not). Corpus re-run on the v0.0.169 tree (2,795-site slice): both lost supabase sites detected again, 7 more sites with only a preconnect or dns-prefetch to a project origin newly detected (all 7 read by evidence region: connection hints to a project origin), and no supabase change between the v0.0.168 and v0.0.169 trees.titleof a<link rel="alternate">feed link (a false positive, the intended effect of this issue).importmap-1539.test.ts,link-rel-1539.test.tsandsupabase-preconnect-1539.test.tspass on main (together with two more files, 193 pass).nik
nc9 commentedon Nov 9, 2026
The last box holds on main at 486cd13: packages/rules/tests/importmap-1539.test.ts ('what is still not a script URL') rejects a CSP meta, an anchor, JSON-LD, a JSON data script and prose, and all 44 tests in the file pass. Import map and small inline module loaders already detect threejs; the large inline module case is #1540.
nik