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

The module/namespace Fable.React from compilation unit Fable.React did not contain the namespace, module or type ReactElement #520

Closed
TerenceHinrichsen opened this issue Oct 31, 2022 · 9 comments

Comments

@TerenceHinrichsen
Copy link

TerenceHinrichsen commented Oct 31, 2022

When running a paket update I found myself stuck with the error per the title of the issue.

The module/namespace 'Fable.React' from compilation unit 'Fable.React' did not contain the namespace, module or type 'ReactElement'

I have updated to the to

  • Fable.Core 4.0.0-theta-006
  • Feliz 2.0.0-prerelease-003

In my paket.lock file I see the following:

 Feliz (2.0.0-prerelease-003)
      Fable.Core (>= 3.2.7)
      Fable.React.Types (>= 18.0)
      Feliz.CompilerPlugins (>= 2.0.0-prerelease-003)
      FSharp.Core (>= 4.7.2)
 Fable.React (9.1)
      Fable.React.Types (>= 18.1)
      Fable.ReactDom.Types (>= 18.0)

Although these libraries are included in my paket.lock I seem unable to reference them in my application. Do I need to specify Fable.React.Types in my paket.references file as well - or is it sufficient to have the reference to Feliz.
I see there was talk about injecting the Fable.React types #509 but as far as I can see all these changes were merged - thus I suspected I would not be facing any challenges, but after trying different combinations of dependencies I am stuck.

Any advice on how I can resolve the error would be tremendously appreciated.

@TerenceHinrichsen TerenceHinrichsen changed the title The module/namespace 'Fable.React' from compilation unit 'Fable.React' did not contain the namespace, module or type 'ReactElement' The module/namespace Fable.React from compilation unit Fable.React did not contain the namespace, module or type ReactElement Oct 31, 2022
@Zaid-Ajaj
Copy link
Owner

is it sufficient to have the reference to Feliz.

That is correct, when using latet Feliz v2+, you don't have to reference Fable.React. It used to be fine to include them together but because Fable.React was a dependency of Feliz but in 2+ that is no more, they only share the Fable.React.Types dependency

@TerenceHinrichsen
Copy link
Author

Thanks for the quick response and confirmation.

We must have a conflicting dependency somewhere. I updated my Fable.FontAwesome dependencies to the beta versions as well and literally have this one "build failure":
The module/namespace Fable.React from compilation unit Fable.React did not contain the namespace, module or type ReactElement

The sad part is that the IDE (Rider) doesn't help me much - usually when I double-click on build error it takes me to the 'source' of the error - but here nothing ;(

I think I will start with a clean repo and add my dependencies one-by-one to see if I can find where it is failing.

@mattgallagher92
Copy link

@TerenceHinrichsen did you resolve this issue? I'm facing it too when testing https://github.com/Dzoukr/SAFEr.Template

@Zaid-Ajaj
Copy link
Owner

@mattgallagher92 When I saw this last time, I deleted bin and obj directories, then restarted Rider. It worked afterwards. Note that dotnet clean isn't enough

@mattgallagher92
Copy link

Thanks for the suggestion @Zaid-Ajaj. Unfortunately it hasn't worked for me. I'll keep digging 🙂

@Zaid-Ajaj
Copy link
Owner

@mattgallagher92 it would help if you could make an example repository with that doesn't work.

@mattgallagher92
Copy link

Will share one later this week 👍

@TerenceHinrichsen
Copy link
Author

Sorry for only responding now, been a hectic week.
@mattgallagher92 - I started from scratch, basically adding my dependencies one of the other (after updating my Paket to the latest version) and the error went away ... sorry.

@mattgallagher92
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants