itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.96k stars 981 forks source link

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

Open buddydudeio opened 2 years ago

buddydudeio commented 2 years ago

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
JeromeBeckett commented 2 years ago

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.

Luca-Carignano commented 2 years ago

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

Restinpeace5500 commented 2 years ago

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

jihoobyeon commented 2 years ago

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.

chapl commented 2 years ago

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.

jihoobyeon commented 2 years ago

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...

taduyde commented 2 years ago

the same issue, is there any update for this.

Mfweb commented 2 years ago

any update?

a-leut commented 2 years ago

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