Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Server-side issue - window is not defined #8

Closed
alverdal opened this issue Feb 20, 2020 · 1 comment
Closed

Server-side issue - window is not defined #8

alverdal opened this issue Feb 20, 2020 · 1 comment

Comments

@alverdal
Copy link

Hi,

I've tried to use react-select-reborn 3.1.0 and make a server-side rendering but I get an error saying that "window is not defined". I found a similar issue for the origin react-select, JedWatson#3802.
I also tried the workaround of populating global.window if window was undefined but that didn't work either.

System.Web.HttpUnhandledException (0x80004005): An unhandled exception occurred. ---> React.Exceptions.ReactScriptLoadException: Error while loading "~/dist/server.main.js": ReferenceError: window is not defined ---> JavaScriptEngineSwitcher.Core.JsRuntimeException: ReferenceError: window is not defined ---> Microsoft.ClearScript.ScriptEngineException: ReferenceError: window is not defined
at V8Exception.ThrowScriptEngineException(V8Exception* )
at Microsoft.ClearScript.V8.V8ContextProxyImpl.Execute(UniqueDocumentInfo documentInfo, String gcCode, Boolean evaluate)
at Microsoft.ClearScript.V8.V8ScriptEngine.ExecuteInternal(UniqueDocumentInfo documentInfo, String code, Boolean evaluate)
at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass100_0.b__0()
at Microsoft.ClearScript.ScriptEngine.ScriptInvokeInternal[T](Func1 func) at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass106_01.b__0()
at Microsoft.ClearScript.V8.V8ContextProxyImpl.InvokeWithLock(Action gcAction)
at Microsoft.ClearScript.V8.V8ScriptEngine.ScriptInvoke[T](Func`1 func)
at JavaScriptEngineSwitcher.V8.V8JsEngine.InnerExecute(String code, String documentName)

@alverdal
Copy link
Author

Issue was solved after input in ticket JedWatson#3802.
Using a webpack setting "aliasFields: []" when creating the bundle.

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

No branches or pull requests

1 participant