microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.17k stars 2.7k forks source link

Module not found: Error: Can't resolve '@fluentui/react-jsx-runtime/jsx-runtime' #29128

Closed VictorRomanov1986 closed 10 months ago

VictorRomanov1986 commented 11 months ago

Library

React Components / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
    Memory: 4.87 GB / 15.41 GB
  Browsers:
    Edge: Spartan (44.22621.2215.0), Chromium (116.0.1938.76)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

https://github.com/VRomanovTau/fluentui-components-bug

Bug Description

Just created a simple SPFx solution with the latest @fluentui/react-components package installed. package.json file content: { "name": "fluentui-components", "version": "0.0.1", "private": true, "engines": { "node": ">=16.13.0 <17.0.0" }, "main": "lib/index.js", "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@fluentui/react-components": "^9.30.4", "@microsoft/sp-core-library": "1.17.0", "@microsoft/sp-lodash-subset": "1.17.0", "@microsoft/sp-office-ui-fabric-core": "1.17.0", "@microsoft/sp-property-pane": "1.17.0", "@microsoft/sp-webpart-base": "1.17.0", "office-ui-fabric-react": "^7.199.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.17.0", "@microsoft/eslint-plugin-spfx": "1.17.0", "@microsoft/rush-stack-compiler-4.5": "0.4.0", "@microsoft/sp-build-web": "1.17.0", "@microsoft/sp-module-interfaces": "1.17.0", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint": "8.7.0", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } }

Trying to bundle this solution got an error (See below). Please advise how to resolve it!

Logs

Module not found: Error: Can't resolve '@fluentui/react-jsx-runtime/jsx-runtime' in 'E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/components/Textarea'  
resolve '@fluentui/react-jsx-runtime/jsx-runtime' in 'E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/components/Textarea'
  Parsed request is a module
  using description file: E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/package.json (relative path: ./lib/components/Textarea)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/components/Textarea/node_modules doesn't exist or is not a directory
      E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/components/node_modules doesn't exist or is not a directory
      E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/node_modules doesn't exist or is not a directory
      E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/node_modules doesn't exist or is not a directory
      E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/node_modules doesn't exist or is not a directory
      E:/Repos/SPFx/fluentui-components/node_modules/node_modules doesn't exist or is not a directory
      E:/Repos/SPFx/node_modules doesn't exist or is not a directory
      E:/Repos/node_modules doesn't exist or is not a directory
      E:/node_modules doesn't exist or is not a directory
      looking for modules in E:/Repos/SPFx/fluentui-components/node_modules
        using description file: E:/Repos/SPFx/fluentui-components/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/package.json (relative path: ./jsx-runtime)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime doesn't exist
            .wasm
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.wasm doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.json doesn't exist
            .css
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.css doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.jsx doesn't exist
            as directory
              E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime doesn't exist
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/components/Textarea/node_modules]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/components/node_modules]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/lib/node_modules]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-textarea/node_modules]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/node_modules]
[E:/Repos/SPFx/fluentui-components/node_modules/node_modules]
[E:/Repos/SPFx/node_modules]
[E:/Repos/node_modules]
[E:/node_modules]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.wasm]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.mjs]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.js]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.json]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.css]
[E:/Repos/SPFx/fluentui-components/node_modules/@fluentui/react-jsx-runtime/jsx-runtime.jsx]
 @ ./node_modules/@fluentui/react-textarea/lib/components/Textarea/renderTextarea.js 1:81-151 7:25-29 8:32-36
 @ ./node_modules/@fluentui/react-textarea/lib/components/Textarea/Textarea.js
 @ ./node_modules/@fluentui/react-textarea/lib/components/Textarea/index.js
 @ ./node_modules/@fluentui/react-textarea/lib/Textarea.js
 @ ./node_modules/@fluentui/react-textarea/lib/index.js
 @ ./node_modules/@fluentui/react-components/lib/index.js
 @ ./lib/webparts/helloWorld/components/HelloWorld.js
 @ ./lib/webparts/helloWorld/HelloWorldWebPart.js
./node_modules/@fluentui/react-toast/lib/components/AriaLive/renderAriaLive.js

Requested priority

Blocking

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

layershifter commented 10 months ago

Was solved by #29129. The release was triggered and will happen in ~ one hour.

ramyasusarla commented 8 months ago

@layershifter I am running into the same error. The output is: Module not found: Package path ./jsx-runtime is not exported from package C:\REPOb\node_modules\@fluentui\react-tree\node_modules\@fluentui\react-jsx-runtime (see exports field in C:\REPO\sources\dev\viva-pulse-web\node_modules\@fluentui\react-tree\node_modules\@fluentui\react-jsx-runtime\package.json)

Any guidance is greatly appreciated!

layershifter commented 8 months ago

@layershifter I am running into the same error. The output is: Module not found: Package path ./jsx-runtime is not exported from package C:\REPOb\node_modules@fluentui\react-tree\node_modules@fluentui\react-jsx-runtime (see exports field in C:\REPO\sources\dev\viva-pulse-web\node_modules@fluentui\react-tree\node_modules@fluentui\react-jsx-runtime\package.json)

Any guidance is greatly appreciated!

@ramyasusarla please fill a new issue.