Skip to content

Asset naming algorithm causes ENAMETOOLONG when using react-navigation and pnpm #748

Open

Description

The name chosen in:

const normalizedName =
url.length === 0
? filename
: `${url.replace(pathSepPattern, '_')}_${filename}`;
const longName = `${normalizedName
.toLowerCase()
.replace(/[^a-z0-9_]/g, '')}.${type}`;

causes ENAMETOOLONG due to unknown reasons (the name is below 255 characters which should be fine on Linux)

error ▶︎ [Error: ENAMETOOLONG: name too long, 
open '/.../drawable-mdpi/node_modules_pnpm_reactnavigation_stack551_a182da6647d2184b7d281770a34a973a_node_modules_reactnavigation_stack_src_views_assets_backiconmask.png'] 
{ errno: -36, 
  code: 'ENAMETOOLONG', 
  syscall: 'open', 
  path: '/.../drawable-mdpi/node_modules_pnpm_reactnavigation_stack551_a182da6647d2184b7d281770a34a973a_node_modules_reactnavigation_stack_src_views_assets_backiconmask.png' 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions