Skip to content

Bug - FileUpload - @patternfly/react-core imports file-selector without declaring it #12729

Backlog

Description

@sebdanielsson

Describe the problem
FileUpload (packages/react-core/src/components/FileUpload/FileUpload.tsx) imports fromEvent from file-selector, but @patternfly/react-core doesn't list file-selector in its dependencies. It only resolves because react-dropzone depends on it and npm or Yarn's node-modules linker hoists it to the root node_modules.

How do you reproduce the problem?

  1. Install an app that uses @patternfly/react-core with a strict layout, for example pnpm with nodeLinker: isolated and hoist: false, or pnpm's global virtual store (enableGlobalVirtualStore: true).
  2. Bundle it (webpack or Rspack).
  3. The build fails: Module not found: Can't resolve 'file-selector' in '.../@patternfly/react-core/dist/esm/components/FileUpload'.

Expected behavior
@patternfly/react-core declares every package it imports, so it resolves in any node_modules layout.

Is this issue blocking you?
Workaround: hoist file-selector (pnpm hoistPattern/publicHoistPattern) or add it with packageExtensions.

What is your environment?

  • pnpm 12 (isolated linker), Node.js 24, @patternfly/react-core 6.6.2 (also on main, 6.7.1-prerelease.1)

Any other information?
react-dropzone 14 depends on file-selector ^2.1.0, so declaring the same range adds no new version to the lockfile.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions