Skip to content

fix(frontend) :: drop source map comments from joined sylesheet - #1584

Merged
lovasoa merged 1 commit into
mainfrom
81reap/issue/1163
Oct 30, 2026
Merged

lovasoa merged 1 commit into
mainfrom
81reap/issue/1163

Conversation

@81reap

@81reap 81reap commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Tom Select's CSS comes with source maps that SQLPage does not care to ship. This then shows up as a 404 error in the browser.

Now we remove the comments when the file is joined.

Fix #1163

Assisted-By :: Claude Opus 5.5

Tom Select's CSS comes with source maps that SQLPage does not care to ship. This then shows up as a 404 error in the browser.

Now we remove the comments when the file is joined.

Fix #1163

Assisted-By :: Claude Opus 5.5
@81reap

81reap commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

reproduction from #1163

$ cat tests/end-to-end/fixtures/repro_1163/index.sql 
SELECT 'hero' AS component, 'Hero' AS title;

$ cat tests/end-to-end/fixtures/repro_1163/test.ts 
import { expect, test } from "../../fixture.ts";

test("every source map an asset names exists", async ({ page }) => {
  const assets = await page.evaluate(() => [...document.querySelectorAll<HTMLScriptElement | HTMLLinkElement>("script[src], link[rel=stylesheet]")].map((e) => ("src" in e ? e.src : e.href)).filter((u) => u.startsWith(location.origin)));
  const missing: string[] = [];
  for (const asset of assets) {
    const body = await (await page.request.get(asset)).text();
    const map = body.match(/sourceMappingURL=(\S+?)(\s|\*\/|$)/)?.[1];
    if (map && !(await page.request.get(new URL(map, asset).href)).ok()) missing.push(new URL(map, asset).pathname);
  }
  expect(missing).toEqual([]);
});
repro_1163 postgres
v0.36.0 ✘ failed
v0.47.0 ✘ failed
tree ✔ passed

On commit 41dd9db: nix run .#reproduce -- repro_1163 postgres v0.36.0 v0.47.0 tree

@81reap
81reap marked this pull request as ready for review October 30, 2026 01:11
@lovasoa
lovasoa added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 8b24454 Oct 30, 2026
55 checks passed
@81reap
81reap deleted the 81reap/issue/1163 branch October 30, 2026 07:29
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.

component hero / tabler.min.js.map and tabler-vendors.min.css.map not loaded

2 participants