react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

react-native-fs fails to autolink or manually link to Windows solution

Open buddydudeio opened this issue 3 years ago • 9 comments

Problem

Running the command npx react-native run-windows --debugger fails to automatically link the react-native-fs module. Manually linking via npx react-native link react-native-fs only results in Android and IOS being linked.

Expected Behavior

Based on the instructions here, I expected npx react-native run-windows --debugger to have autolinked react-native-fs for Windows; I then expected npx react-native link react-native-fs to have resolved the autolinking issue.

Logs

npx react-native run-windows --debugger

Found Windows app project, config:
{
  folder: 'C:\\Users\\Devon\\Documents\\codie',
  sourceDir: 'windows',
  solutionFile: 'codie.sln',
  project: {
    projectFile: 'codie\\codie.vcxproj',
    projectName: 'codie',
    projectLang: 'cpp',
    projectGuid: '{64bd0c58-52d9-4643-a09a-5030c152f4b9}'
  },
  experimentalFeatures: {
    UseHermes: 'true',
    UseWinUI3: 'true',
    UseExperimentalNuget: 'false'
  }
}
Parsing dependencies...
(node:9904) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
react-native-fs has Windows implementation, config:
{
  folder: 'C:\\Users\\Devon\\Documents\\codie\\node_modules\\react-native-fs',
  projects: [],
  solutionFile: 'RNFS.sln',
  nugetPackages: [],
  sourceDir: 'windows'
}
 × Auto-linking...
Error: Autolinking: Found a Windows solution for react-native-fs but no React Native for Windows native module projects. (62ms)
 × Autolinking failed. Found a Windows solution for react-native-fs but no React Native for Windows native module projects

npx react-native link react-native-fs

warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release.
Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
(node:4572) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
info iOS module "react-native-fs" is already linked
info Linking "react-native-fs" Android dependency
info Android module "react-native-fs" has been successfully linked

buddydudeio avatar Jan 03 '22 15:01 buddydudeio

It looks like this library doesn't work on RNW > 0.60. Various classes in RNFSManager.cs look to have been changed or removed since then. I also think ReactNative should now be Microsoft.ReactNative in the solution file? In any case I've been trying to get this working for days with no luck.

JeromeBeckett avatar Feb 03 '22 18:02 JeromeBeckett

Hi, have you found a solution? I currently have the same problem, thanks.

Luca-Carignano avatar Mar 15 '22 14:03 Luca-Carignano

Hi, I have the same problem, Anyone found a solution for this? I ran the command "npx react-native autolink-windows" This is the error

image

Restinpeace5500 avatar Mar 21 '22 05:03 Restinpeace5500

Any progress in this issue? I have same error on Windows. I can work on macOS but I also have to run at Windows eventually.

jihoobyeon avatar Apr 07 '22 11:04 jihoobyeon

Any progress in this issue? I have same error on Windows. I can work on macOS but I also have to run at Windows eventually.

There has been progress on this issue, see this answer.

chapl avatar May 09 '22 12:05 chapl

Any progress in this issue? I have same error on Windows. I can work on macOS but I also have to run at Windows eventually.

There has been progress on this issue, see this answer.

Yes, thanks, I also found it, and as mentioned here, there's another fork that works on Windows even when file path contains non-latin character!

Now all we have to is just waiting for merge those into this repo, and publish as npm package...

jihoobyeon avatar May 09 '22 13:05 jihoobyeon

the same issue, is there any update for this.

taduyde avatar Jul 12 '22 05:07 taduyde

any update?

Mfweb avatar Jul 28 '22 14:07 Mfweb

I left my update here. This works for me on the current version of react native windows dependencies I installed today:

npm uninstall react-native-fs
npm install https://github.com/a-leut/react-native-fs#dev
npx react-native run-windows

a-leut avatar Aug 28 '22 22:08 a-leut