fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Bug]: Cannot find module '@fluentui/react' or its corresponding type declarations.

Open HarminderSethi opened this issue 4 years ago • 26 comments

Library

React / v8 (@fluentui/react)

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 5.92 GB / 15.76 GB
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (104.0.1293.63)
    Internet Explorer: 11.0.22000.120

Are you reporting Accessibility issue?

no

Reproduction

N/A

Bug Description

Actual Behavior

After updating the @fluentui/react with 8.90.2 version, I started getting error "Cannot find module '@fluentui/react' or its corresponding type declarations". in SPFx solution(version 1.15.2). version 8.90.1 and 8.90.0 working fine. image

Expected Behavior

should work similar to previous release.

Logs

No response

Requested priority

High

Products/sites affected

N/A

Are you willing to submit a PR to fix?

no

Validations

  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] The provided reproduction is a minimal reproducible example of the bug.

HarminderSethi avatar Aug 23 '22 13:08 HarminderSethi

I'm getting the same error :

import { Stack } from "@fluentui/react"

Found 62 errors in 9600 ms

raphy@pc:~/FPlayground$ yarn add --dev @types/@fluentui/react
yarn add v1.22.19
[1/4] Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://[email protected]/fluentui/react.git
Directory: /home/raphy/FPlayground
Output:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
raphy@pc:~/FPlayground$ 

Other Info:

O.S.: Ubuntu 20.04 Dekstop
node: v16.15.1
 "@fluentui/react": "^8.90.2"

raphael10-collab avatar Aug 23 '22 13:08 raphael10-collab

This is related to #24464

TonyTroeff avatar Aug 23 '22 13:08 TonyTroeff

Ok, I spun up a local create react app and am able to repro this issue. I'm looking into it.

micahgodbolt avatar Aug 23 '22 15:08 micahgodbolt

We found the bug in our publishing code. We'll have a PR up shortly and release another version.

micahgodbolt avatar Aug 23 '22 16:08 micahgodbolt

This is set as closed, but the errors are still present for me. I have deleted node_modules and have re-installed @FluentUI

Can anyone confirm that this is fixed?

rudymiked avatar Aug 23 '22 18:08 rudymiked

image

still see this message after re-installing @fluentui

rudymiked avatar Aug 23 '22 20:08 rudymiked

@rudymiked version 8.90.2 is marked as deprecated. version 8.90.1 is the latest active version. As confirmed by @micahgodbolt new version with the fix will be released soon. image

HarminderSethi avatar Aug 24 '22 01:08 HarminderSethi

Does this effect packages other than @fluentui/react? I can't get my node_modules in an existing project back in to a working state as some dependencies of @fluentui/react (like @fluentui/react-hooks) seem to show the same problem. Trying to install an earlier version of @fluentui/react still installs latest versions of dependencies which are broken.

markdon avatar Aug 24 '22 02:08 markdon

These errors occur on v8.11.x as well (@fluentui/[email protected]). I deleted node modules and reinstalled packages (using 'npm install'), but I still receive errors.

image

deepak-chandani avatar Aug 24 '22 04:08 deepak-chandani

I cannot make any version of @fluentui/react working as long as it needs install now

jarvan-jiang avatar Aug 24 '22 06:08 jarvan-jiang

Facing same problem while building the project. Had to switch to office-fabric-ui-react for time being. SPFx version 1.15.2

HarminderSethi avatar Aug 24 '22 06:08 HarminderSethi

This is still not working for us. Please share if anyone has found a solution or workaround.

abhiagra avatar Aug 24 '22 06:08 abhiagra

Hey, have had the same issue since yesterday. My fluent-UI version is "@fluentui/react": "^8.72.0", my react version 17 everything work on sendbox when build I'm getting the same errors as the thread owner gets Error: Can't resolve '@fluentui/react-hooks' in '/app/node_modules/@fluentui/react/lib/c

amitShimon1983 avatar Aug 24 '22 09:08 amitShimon1983

hello @micahgodbolt, I am still facing the same issue, have delete node_modules and package-lock file, and reinstall modules. but no luck, i have tried with 8.90.2 and 8.91.0 version of fluentUI

ag0059985 avatar Aug 24 '22 10:08 ag0059985

Same problem with 8.91.0 version

ol74eg avatar Aug 24 '22 10:08 ol74eg

same with 8.90.2 version

khaledfarghaly avatar Aug 24 '22 10:08 khaledfarghaly

Also seeing the same when using 8.90.2 @micahgodbolt

AtDH01 avatar Aug 24 '22 11:08 AtDH01

The workaround is to use previous version of these packages:

With yarn:

"resolutions": {
    "@fluentui/react-hooks": "8.6.7",
    "@fluentui/style-utilities": "8.7.7",
    "@fluentui/foundation-legacy": "8.2.15",
    "@fluentui/font-icons-mdl2": "8.4.8",
    "@fluentui/react-focus": "8.8.0",
    "@uifabric/styling**/@fluentui/theme": "1.7.7",
    "@fluentui/react/**/@fluentui/theme": "2.6.12"
  },

With npm (8.3.0+):

  "overrides": {
    "@fluentui/react": {
      "@fluentui/react-hooks": "8.6.7",
      "@fluentui/style-utilities": "8.7.7",
      "@fluentui/foundation-legacy": "8.2.15",
      "@fluentui/font-icons-mdl2": "8.4.8",
      "@fluentui/react-focus": "8.8.0",
      "@fluentui/theme": "2.6.12"
    },
    "@uifabric/styling": {
      "@fluentui/theme": "1.7.7"
    }
  }

You might need to add another packages to this list. Just check build log for the failing package. Then go to its version list and find one that was released before yesterday.

Front-start avatar Aug 24 '22 11:08 Front-start

thanks @Front-start I have pasted the following packages as dependencies in package.json file, and it worked.

thanks again !!

"@fluentui/react-hooks": "8.6.7",
      "@fluentui/style-utilities": "8.7.7",
      "@fluentui/foundation-legacy": "8.2.15",
      "@fluentui/font-icons-mdl2": "8.4.8",
      "@fluentui/react-focus": "8.8.0",
      "@fluentui/theme": "2.6.12"

ag0059985 avatar Aug 24 '22 11:08 ag0059985

thanks @Front-start I have pasted the following packages as dependencies in package.json file, and not getting the error.

"@fluentui/react-hooks": "8.6.7",
      "@fluentui/style-utilities": "8.7.7",
      "@fluentui/foundation-legacy": "8.2.15",
      "@fluentui/font-icons-mdl2": "8.4.8",
      "@fluentui/react-focus": "8.8.0",
      "@fluentui/theme": "2.6.12"

Hey, I did as you suggested, but I'm working with yarn workspaces, and it didn't help me, so I had to downgrade to fluent version 7. if someone knows how I can solve it, ill be more then grateful

amitShimon1983 avatar Aug 24 '22 11:08 amitShimon1983