Skip to content

React has not been loaded correctly. Please expose your version of React as global variables named 'React', 'ReactDOM' and 'ReactDOMServer', or enable the 'LoadReact' configuration option to use the built-in version of React. #552

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

Closed
thecyclingfarmer opened this issue Jun 15, 2018 · 4 comments

Comments

@thecyclingfarmer
Copy link

We are experiencing this issue after we upgraded React and ReactDOM to 16.4.1. We bundle our own React with webpack and we can verify that React, ReactDOM and ReactDOMServer are exposed as global variables. We narrowed down the problem to the ReactDom version, after we backed to ReactDOM 16.4.0 the issue disappears (React still on 16.4.1). Any ideas?

Thanks!

@dustinsoftware
Copy link
Member

I’ll see if I can repro with 16.4.1. Thanks for reporting the issue.

@benverhees
Copy link

benverhees commented Jun 18, 2018

We are experiencing the same issue, 16.4.0 works fine, 16.4.1 gives this error when calling ReactEnvironment.Current

[ReactNotInitialisedException: React has not been loaded correctly. Please expose your version of React as global variables named 'React', 'ReactDOM' and 'ReactDOMServer', or enable the 'LoadReact' configuration option to use the built-in version of React.]
   React.JavaScriptEngineFactory.EnsureReactLoaded(IJsEngine engine) +151
   React.JavaScriptEngineFactory.InitialiseEngine(IJsEngine engine) +215
   JSPool.JsPool`2.CreateEngine() +255
   JSPool.JsPool`2.PopulateEngines() +23
   JSPool.JsPool`2..ctor(JsPoolConfig`1 config) +265
   React.JavaScriptEngineFactory.CreatePool() +624
   React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem) +177
   lambda_method(Closure , Object[] ) +187
   React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +618

[TinyIoCResolutionException: Unable to resolve type: React.JavaScriptEngineFactory]
   React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +948
   React.TinyIoC.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +157
   React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +855
   React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +520

[TinyIoCResolutionException: Unable to resolve type: React.ReactEnvironment]
   React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +794
   React.TinyIoC.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +157
   React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +855
   React.TinyIoC.TinyIoCContainer.Resolve() +54

@dustinsoftware
Copy link
Member

I believe your issue is related to #555 , I'll post updates there

@dustinsoftware
Copy link
Member

Discussion moved to #555

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