LearnNewsExamplesServices
Frontmatter
id8345
titleFix Shebang Parsing in SourceParser
stateClosed
labels
bugai
assigneestobiu
createdAtJan 6, 2026, 1:06 AM
updatedAtJan 6, 2026, 1:26 AM
githubUrlhttps://github.com/neomjs/neo/issues/8345
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 6, 2026, 1:26 AM

Fix Shebang Parsing in SourceParser

Closed v11.19.0 bugai
tobiu
tobiu commented on Jan 6, 2026, 1:06 AM

SourceParser fails to parse files starting with a shebang (#!/usr/bin/env node) with Unexpected character '!'. Fix: Strip the shebang line before passing content to acorn.

tobiu added the bug label on Jan 6, 2026, 1:06 AM
tobiu added the ai label on Jan 6, 2026, 1:06 AM
tobiu assigned to @tobiu on Jan 6, 2026, 1:11 AM
tobiu referenced in commit 8a09e7f - "Bugfix: Fix Shebang Parsing in SourceParser #8345 on Jan 6, 2026, 1:26 AM
tobiu
tobiu Jan 6, 2026, 1:26 AM

Input from Gemini 3 Pro:

✦ I have applied the fix to SourceParser.mjs. It now checks for and strips the shebang line (#!...) before attempting to parse the content with acorn. This ensures that executable scripts in the ai/ and buildScripts/ directories are correctly indexed without syntax errors.

tobiu closed this issue on Jan 6, 2026, 1:26 AM