Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error on Windows: "Filename or extension is too long" (os error 206) with Deno/esbuild #28549

Open
leongobbs opened this issue Mar 19, 2025 · 0 comments

Comments

@leongobbs
Copy link

leongobbs commented Mar 19, 2025

Version: Deno 2.2.4

Error description

When running a project build on Windows, multiple errors occur:

Error: Build failed with 201 errors:
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': The file name or extension is too long. (os error 206)
 [ERROR] Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206) [plugin deno-loader] 
...

The error occurs when using Deno (v2.2.4) and esbuild (v0.20.2).


Steps to reproduce

  1. Environment:
  • OS: Windows 11
  • Deno: 2.2.4
  • esbuild: 0.20.2
  1. Actions:
deno task www
  1. Result: Error with code os error 206.

Expected behavior

The project should build without errors, even if the file paths are long.

--

Additional information

Error log:

`X [ERROR] Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': The file name or extension is too long. (os error 206) [plugin deno-loader]
Error: Build failed with 201 errors:
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': The file name or extension is too long. (os error 206)
...
    at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1626:15)
    at https://deno.land/x/[email protected]/mod.js:1034:25
    at runOnEndCallbacks (https://deno.land/x/[email protected]/mod.js:1461:45)
    at buildResponseToResult (https://deno.land/x/[email protected]/mod.js:1032:7)
    at https://deno.land/x/[email protected]/mod.js:1061:16
    at responseCallbacks.<computed> (https://deno.land/x/[email protected]/mod.js:679:9)
    at handleIncomingPacket (https://deno.land/x/[email protected]/mod.js:739:9)
    at readFromStdout (https://deno.land/x/[email protected]/mod.js:655:7)
    at https://deno.land/x/[email protected]/mod.js:1974:11
    at eventLoopTick (ext:core/01_core.js:177:7) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]

}
An error occurred during route handling or page rendering.
Error: Build failed with 201 errors:
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
   at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1626:15)
    at https://deno.land/x/[email protected]/mod.js:1034:25
    at runOnEndCallbacks (https://deno.land/x/[email protected]/mod.js:1461:45)
    at buildResponseToResult (https://deno.land/x/[email protected]/mod.js:1032:7)
    at https://deno.land/x/[email protected]/mod.js:1061:16
    at responseCallbacks.<computed> (https://deno.land/x/[email protected]/mod.js:679:9)
    at handleIncomingPacket (https://deno.land/x/[email protected]/mod.js:739:9)
    at readFromStdout (https://deno.land/x/[email protected]/mod.js:655:7)
    at https://deno.land/x/[email protected]/mod.js:1974:11
    at eventLoopTick (ext:core/01_core.js:177:7) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}
Error: Build failed with 201 errors:
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
...
    at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1626:15)
    at https://deno.land/x/[email protected]/mod.js:1034:25
    at runOnEndCallbacks (https://deno.land/x/[email protected]/mod.js:1461:45)
    at buildResponseToResult (https://deno.land/x/[email protected]/mod.js:1032:7)
    at https://deno.land/x/[email protected]/mod.js:1061:16
    at responseCallbacks.<computed> (https://deno.land/x/[email protected]/mod.js:679:9)
    at handleIncomingPacket (https://deno.land/x/[email protected]/mod.js:739:9)
    at readFromStdout (https://deno.land/x/[email protected]/mod.js:655:7)
    at https://deno.land/x/[email protected]/mod.js:1974:11
    at eventLoopTick (ext:core/01_core.js:177:7) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}
Error: Build failed with 201 errors:
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
error: Failed to spawn 'C:\Users\allab\.deno\bin\deno.EXE': Имя файла или его расширение имеет слишком большую длину. (os error 206)
...
    at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1626:15)
    at https://deno.land/x/[email protected]/mod.js:1034:25
    at runOnEndCallbacks (https://deno.land/x/[email protected]/mod.js:1461:45)
    at buildResponseToResult (https://deno.land/x/[email protected]/mod.js:1032:7)
    at https://deno.land/x/[email protected]/mod.js:1061:16
    at responseCallbacks.<computed> (https://deno.land/x/[email protected]/mod.js:679:9)
    at handleIncomingPacket (https://deno.land/x/[email protected]/mod.js:739:9)
    at readFromStdout (https://deno.land/x/[email protected]/mod.js:655:7)
    at https://deno.land/x/[email protected]/mod.js:1974:11
    at eventLoopTick (ext:core/01_core.js:177:7) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

`

Attempts to solve (didn't work):

  • Updating Deno to the latest version.
  • Moving the project to the root directory (C:\projects\...).
  • Enabling long paths in Windows via registry (LongPathsEnabled=1).
  • Using subst to shorten the path.
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

No branches or pull requests

1 participant