Skip to content

Bug - react-core - Module not found: Error: Can't resolve '@patternfly/react-core/next' #8284

@hamzab70

Description

@hamzab70

Describe the problem
I'm developing a OpenShift Console Dynamic Plugin and when trying to use the react-core/next Select, webpack can't find the module and load it. The project is called X-Plugin and the output is as follows:

ERROR in ./components/select-icodes.tsx 2:0-79
Module not found: Error: Can't resolve '@patternfly/react-core/next' in '/home/X-Plugin/src/components'
resolve '@patternfly/react-core/next' in '/home/X-Plugin/src/components'
  Parsed request is a module
  using description file: /home/X-Plugin/package.json (relative path: ./src/components)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /home/X-Plugin/src/components/node_modules doesn't exist or is not a directory
      /home/X-Plugin/src/node_modules doesn't exist or is not a directory
      looking for modules in /home/X-Plugin/node_modules
        existing directory /home/X-Plugin/node_modules/@patternfly/react-core
          using description file: /home/X-Plugin/node_modules/@patternfly/react-core/package.json (relative path: .)
            using description file: /home/X-Plugin/node_modules/@patternfly/react-core/package.json (relative path: ./next)
              no extension
                Field 'browser' doesn't contain a valid alias configuration
                /home/X-Plugin/node_modules/@patternfly/react-core/next doesn't exist
              .ts
                Field 'browser' doesn't contain a valid alias configuration
                /home/X-Plugin/node_modules/@patternfly/react-core/next.ts doesn't exist
              .tsx
                Field 'browser' doesn't contain a valid alias configuration
                /home/X-Plugin/node_modules/@patternfly/react-core/next.tsx doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /home/X-Plugin/node_modules/@patternfly/react-core/next.js doesn't exist
              .jsx
                Field 'browser' doesn't contain a valid alias configuration
                /home/X-Plugin/node_modules/@patternfly/react-core/next.jsx doesn't exist
              as directory
                /home/X-Plugin/node_modules/@patternfly/react-core/next doesn't exist
      /home/hamza/zurich-ocp-projects/node_modules doesn't exist or is not a directory
      /home/hamza/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
 @ ./components/BillingTable.tsx 3:0-47 53:48-60
 @ container entry BillingTable[0]

webpack 5.74.0 compiled with 1 error in 5408 ms

How do you reproduce the problem?
Use https://github.com/openshift/console-plugin-template update to the last react-core version and try to use one of the react-core/next/Select examples.

Expected behavior
To load the module and work as expected.

What is your environment?

  • OS: Windows 10 WSL2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions