Symptom
mastra dev fails at boot when a file under src/mastra/tools/ imports a name from a workspace package that the entry file does not import. The line is SyntaxError: The requested module '…/node_modules/.cache/<pkg>.mjs' does not provide an export named 'X'.
Evidence what you'll see
DevBundler.watch()analyzed[entryFile, <#server stub>]. Workspace-package bundles then exported only the names that analysis saw.mastra buildincludes resolved tool paths inanalyzeBundle(), so build works and dev does not.--toolscannot work around it becausegetAllToolPaths()always adds the default glob.- The pull request's reproduction printed
SyntaxError: The requested module '.../.mastra/.build/shared.mjs' does not provide an export named 'B'.
Why it happens
Tool files are not reachable from the Mastra entry, so their workspace-package imports were dropped from the dev bundle. Pull request 27132 resolves tool paths before building the watcher options and adds them to analysisEntries.
Affected versions
mastra 1.31.3 through 1.34.1. Reproduced in a monorepo where the entry imports one export and a src/mastra/tools/ file imports another.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
mastra devboots when the entry importsAand a tool file importsBfrom the same workspace package, withoutdoes not provide an export named 'B'.
If it still fails
- The linked issue does not describe the missing-export boot failure after a tree that contains pull request 27132. Tag
@mastra/core@1.77.0is earlier than that merge.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it