Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on VS2022: ReactNativeFs\ReactPackageProvider.idl(3): error MIDL2025: [msg]syntax error [context]: expecting . near "]" #7

Closed
flashkicker opened this issue Sep 5, 2023 · 9 comments
Labels
Ready Ready for release.

Comments

@flashkicker
Copy link

flashkicker commented Sep 5, 2023

Hello, first of all great initiative on creating this updated fork for react-native-fs 👏👏👏

I've been trying to install and build this fork on my project and it builds successfully on the JS side, autolinks without any issues as well, however, when when building on VS 2022 I get the following error:

C:\project\node_modules\@dr.pogodin\react-native-fs\windows\ReactNativeFs\ReactPackageProvider.idl(3): error MIDL2025: [msg]syntax error [context]: expecting . near "]"

Any ideas or insight into what this error means and how to move past it would be hugely appreciated! @birdofpreyru

Happy to provide any info that you may need to better understand the error :)

@birdofpreyru
Copy link
Owner

Hi @flashkicker ,

I don't know, windows\ReactNativeFs\ReactPackageProvider.idl is a very simple file, coming from the standard RN library template for Windows, created by react-native-windows, which does not require any customization for a particular library, I believe. To be honest, I hence don't know much about IDL files, but looking at it, I guess its third line [webhosthidden] is some sort of placeholder, where something is injected during the build. As it complains about it, my first naive guess is either you are trying to build it with older RN / RNW versions, and it is incompatible (I develop with the latest versions, and if it is the case, please tell what versions were that, so I can specify the requirement in package.json); or probably you haven't done a completely clean build, and some artifacts from an old build interfere with the new one.

Have you tried to build the Example app, by the way?

@flashkicker
Copy link
Author

flashkicker commented Sep 6, 2023

@birdofpreyru We are currently on RN 0.70 and 0.70.19 for RNW. We are currently in the process of upgrading to RN 0.72 in our project.

I did try a complete clean build multiple times on both VS2022 and VS2019 and saw the same error. I also compared the .idl file with other community libraries in our project and they look exactly the same!

Haven't tried the example app yet, but will do!

@birdofpreyru
Copy link
Owner

Ok, @flashkicker , keep me posted if it works for you with 0.72.

@birdofpreyru birdofpreyru added the On Hold Blocked for some reason. label Sep 6, 2023
@flashkicker
Copy link
Author

I'm seeing this error when running the example app:

image

All I did was npm install -> npm run windows

I'm on node version 16.13.1 @birdofpreyru

@birdofpreyru
Copy link
Owner

Have you done npm install both in the root folder of the code base, and inside its example folder?

@flashkicker
Copy link
Author

It worked after running npm install in the root folder :) I hadn't done that. Thanks!

@birdofpreyru
Copy link
Owner

birdofpreyru commented Sep 8, 2023

Great!

A note for myself — README.md of Example App should be updated, to make it clear how to install & run it.

@flashkicker
Copy link
Author

Our upgrade to RN 0.72 is taking longer than expected. Is there any way I can modify this fork to be on RN 0.70 just to test it out? @birdofpreyru

@birdofpreyru
Copy link
Owner

Not that I really know, out of my head, what are the differences between RN 0.70 and 0.72 that prevent it from work. However, the library scaffolding was created using create-react-native-library CLI, and then adding Windows support following these instructions. In theory, you can use these to create library scaffoldings for specific RN versions, 0.70 and 0.72, compare them, see what is the difference, and maybe apply it to the library... In practice, I am not sure it is worth the efforts.

birdofpreyru added a commit that referenced this issue Sep 18, 2023
@birdofpreyru birdofpreyru added In Progress Work in progress. and removed On Hold Blocked for some reason. labels Sep 27, 2023
birdofpreyru added a commit that referenced this issue Sep 28, 2023
@birdofpreyru birdofpreyru added Ready Ready for release. and removed In Progress Work in progress. labels Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready Ready for release.
Projects
None yet
Development

No branches or pull requests

2 participants