WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@dane-ai-mastra
Copy link
Contributor

@dane-ai-mastra dane-ai-mastra bot commented Dec 9, 2025

Backporting #10952 to the 0.x branch

(cherry picked from commit 2a54120)

The `hasPaths()` function was using `JSON.parse()` to read
tsconfig.json, which fails on JSONC comments. This caused path aliases
like `@src/*` to not be resolved, leading to them being treated as npm
scoped packages.

Before (broken):
```js
const config = JSON.parse(fs.readFileSync(tsConfigPath, 'utf8'));
// throws on comments, catch returns false
```

After (fixed):
```js
const content = fs.readFileSync(tsConfigPath, 'utf8');
const config = JSON.parse(stripJsonComments(content));
// now works with JSONC comments
```

Fixes #10942

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Bug Fixes**
* Fixed parsing of TypeScript configuration files containing comments,
ensuring path aliases (e.g., `@src/*`) are correctly recognized instead
of being misclassified as npm scopes.

* **Tests**
* Added comprehensive test coverage for configuration file parsing and
plugin integration.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 2a54120)
@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 6bea68b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@mastra/deployer Patch
mastra Patch
@mastra/deployer-cloud Patch
@mastra/deployer-cloudflare Patch
@mastra/deployer-netlify Patch
@mastra/deployer-vercel Patch
create-mastra Patch
@mastra/dane Patch
@mastra/core Patch
@mastra/server Patch
@mastra/mcp-docs-server Patch
@mastra/client-js Patch
@mastra/react Patch
@mastra/longmemeval Patch
@mastra/playground-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
assistant-ui Error Error Dec 9, 2025 10:46pm
mastra-docs Ready Ready Preview Comment Dec 9, 2025 10:46pm

@wardpeet wardpeet merged commit ceb04d6 into 0.x Dec 9, 2025
24 of 37 checks passed
@wardpeet wardpeet deleted the backport/fix-tsconfig-jsonc-comments-10942-10952 branch December 9, 2025 22:46
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.

3 participants