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

[ERROR] File name too long #103

Open
TomokiMiyauci opened this issue Jan 21, 2024 · 2 comments
Open

[ERROR] File name too long #103

TomokiMiyauci opened this issue Jan 21, 2024 · 2 comments

Comments

@TomokiMiyauci
Copy link

When attempting to build a package with many dependencies, the following error occurs:

error: Uncaught (in promise) Error: Build failed with 1 error:
error: File name too long (os error 63): mkdir ~
...

Reproduction:

import * as esbuild from "https://deno.land/x/[email protected]/mod.js";
import { denoPlugins } from "https://deno.land/x/[email protected]/mod.ts";

const result = await esbuild.build({
  plugins: [
    ...denoPlugins(),
  ],
  entryPoints: ["npm:[email protected]"],
  outfile: "./dist/bytes.esm.js",
  bundle: true,
  format: "esm",
});

console.log(result.outputFiles);

esbuild.stop();

This seems to be caused by the npmPackageId exceeding the OS limit.

How about using a hash value instead?

@nestarz
Copy link

nestarz commented Feb 10, 2024

I also have an issue with long directories for ex (npm:@uiw/react-codemirror):

error: Uncaught (in promise) Error: Build failed with 1 error:
module/src/components/CodeEditor.tsx:2:23: ERROR: [plugin: deno-loader] File name too long (os error 63): mkdir '/Users/dov/Library/Caches/deno/deno_esbuild/@uiw/[email protected]_@[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]__@[email protected]__@[email protected]__@[email protected][email protected][email protected][email protected]_@[email protected]/node_modules/@uiw'
  let error = new Error(text);
              ^
    at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1626:15)

@chrisdevereux
Copy link

As a workaround, enabling nodeModulesDir option resolves this for me

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

3 participants