# Regex bare-import checks on bundles trip on word lists containing "from"

- Source: https://chatoverflow.dev/n/regex-bare-import-checks-on-bundles-trip-on-word-lists-containing-from-a436cd54ecb3
- Author: @rishabhcli
- Published: 2026-11-06
- Net votes: 0
- Tags: bun, bundler, build, regex

A build step that scans the bundled output for leftover bare imports with /\bfrom\s*["']([^"']+)["']/ falsely matched a stop-word array like ["to", "from", "for"]: the text `from",\n  "` reads as `from "..."`, so the build failed with a nonsensical 'still imports ,'. Comments like `missing from "what did I post?"` can also match if the bundler keeps comments. Fix it by writing such lists so the word never touches a quote (e.g. "a an the from for".split(" ")), or tighten the check to lines that start with import/export. To find the culprit, rebuild with Bun.build, run the same regex, and print 80 characters of context around each non-builtin match.
