Repository navigation
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.47Found to occur in 3.47Found to occur in 3.47t: top-crasherteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Summary
flutter pub get crashes on Windows with an unhandled ProcessPackageException (ProcessException: The filename or extension is too long, OS error code 206 / ERROR_FILENAME_EXCED_RANGE) in _DefaultPub._preloadPubCache (package:flutter_tools/src/dart/pub.dart:645) / ErrorHandlingProcessManager.runSync (package:flutter_tools/src/base/error_handling_io.dart:1310).
Crash Telemetry (Flutter stable/3.47.7)
- Signature:
ProcessPackageException at LocalProcessManager.runSync at package:process/src/interface/local_process_manager.dart-313da74f - Rank: fix syntax error #10 Top Crasher in
3.47.7 - Total Occurrences: 19 (3.7% of Top 10, 1.9% of all
3.47.7crashes, ~2.5 crashes/day) - Platform Distribution: Windows: 19 (100.0%)
- Sample Command:
flutter pub get - Error:
ProcessException: The filename or extension is too long (at ../../runtime/bin/process_win.cc:579) | Command: C:\Users\User\AppData\Local\Temp\claude\d--Dotlinker-Laravel-New-Set...
Stack Trace
#0 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:118)
#1 ErrorHandlingProcessManager.runSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:1310)
#2 _runSync (package:flutter_tools/src/base/error_handling_io.dart:1118)
#3 ErrorHandlingProcessManager.runSync (package:flutter_tools/src/base/error_handling_io.dart:1308)
#4 _DefaultPub._preloadPubCache (package:flutter_tools/src/dart/pub.dart:645)
#5 _DefaultPub._getPubCacheIfAvailable (package:flutter_tools/src/dart/pub.dart:624)
#6 _DefaultPub._createPubEnvironment (package:flutter_tools/src/dart/pub.dart:664)
#7 _DefaultPub._runWithStdioInherited (package:flutter_tools/src/dart/pub.dart:379)
Root Cause
- In
_DefaultPub._preloadPubCache(package:flutter_tools/src/dart/pub.dart),flutter_toolspasses all.tar.gzarchive paths in$FLUTTER_ROOT/.pub-preload-cacheto a single_processManager.runSync(<String>[..._pubCommand, 'cache', 'preload', ...cacheFiles])invocation. When the Flutter SDK or current working directory is located in a deep Windows path (or the concatenated.tar.gzpaths exceed WindowsCreateProcessW/MAX_PATHlimits inruntime/bin/process_win.cc), Windows fails with error code206(ERROR_FILENAME_EXCED_RANGE:The filename or extension is too long). - In
_handleWindowsException(package:flutter_tools/src/base/error_handling_io.dart:1467-1522), error code206is not listed in theswitch (errorCode)statement, so_onProcessExceptionreturns without throwing aToolExitand_runSyncrethrows the rawProcessPackageException.
Recommendation
- Add
const kFilenameExcedRange = 206;(ERROR_FILENAME_EXCED_RANGE) to_handleWindowsExceptioninpackage:flutter_tools/src/base/error_handling_io.dartso process/filesystem calls failing with error code206exit cleanly with aToolExitinstructing the user to move the project/SDK to a shorter path or enable Windows Long Paths. - In
_DefaultPub._preloadPubCache(package:flutter_tools/src/dart/pub.dart), batchcacheFiles(or run withworkingDirectory: preloadCacheDir.pathusing relative archive filenames) sodart pub cache preloaddoes not exceed Windows command-line / path length limits.
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.47Found to occur in 3.47Found to occur in 3.47t: top-crasherteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
[flutter_tools] Exit cleanly when Windows path exceeds MAX_PATH (OS E…
[flutter_tools] Exit cleanly when Windows path exceeds MAX_PATH (OS E…
[flutter_tools] Pass relative archive paths to pub cache preload (flu…
[beta] [flutter_tools] Exit cleanly when Windows path exceeds MAX_PAT…
[stable] [flutter_tools] Exit cleanly when Windows path exceeds MAX_P…
[flutter_tools] Exit cleanly when Windows path exceeds MAX_PATH (OS E…
[flutter_tools] Pass relative archive paths to pub cache preload (flu…
github-actions commentedon Nov 4, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.