Skip to content

HELP, React.Exceptions.BabelException: Unable to get value of the property 'split': Object is null or undefined #220

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
vincentshow opened this issue Jan 28, 2016 · 17 comments

Comments

@vincentshow
Copy link

exception occured when i trying to compile React.Sample.Mvc4 which is downloaded from github.
my ide is vs2012 and install reactjs.net for mvc4(latest version 2.2) by nuget. any suggestion?

@vincentshow
Copy link
Author

i found that the inner exception occured when JavaScriptEngineSwitcher.Core.JsEngineBase.ExecuteResource processing the resource React.Resources.babel.generated.min.js, and throwed by MsieJavaScriptEngine.ActiveScript. ParseScriptText when calling this._activeScriptParse32.ParseScriptText.

whatever, no solution yet...

@alexlblount
Copy link

I'm also receiving this error, but it only happens on the server after I publish. When I run the project locally, I have no issues.

@Daniel15
Copy link
Member

Daniel15 commented Feb 3, 2016

Sorry I haven't had time to look into this yet, and I'm about to go on a vacation from today until 13th February. Could you please try ReactJS.NET 2.1 and see if that works?

@Daniel15
Copy link
Member

Daniel15 commented Feb 3, 2016

(2.1 is the previous version)

@rosdi
Copy link
Contributor

rosdi commented Feb 3, 2016

I had the same error.. but when I downgraded to 2.1.2 the problem disappears...

@Daniel15
Copy link
Member

Daniel15 commented Feb 3, 2016

It's probably due to the upgrade to Babel 6. I'm about to go on vacation
but I can take a look once I'm back. Feel free to use 2.1.2 in the
meantime.

Sent from my phone.
On Feb 3, 2016 12:44 PM, "Rosdi Kasim" [email protected] wrote:

I had the same error.. but when I downgraded to 2.1.2 the problem
disappears...


Reply to this email directly or view it on GitHub
#220 (comment).

@Pabloitto
Copy link

I have the same issue, any update ??

@dogen-z
Copy link

dogen-z commented Feb 15, 2016

@Daniel15 : Hope you had a great vacation.

Same here. Downgrading to 2.1.2 does not help either.
I then get an issue given below ...

React.Exceptions.BabelException: Expected identifier ---> JavaScriptEngineSwitcher.Core.JsRuntimeException: Expected identifier ---> MsieJavaScriptEngine.JsRuntimeException: Expected identifier

Interestingly, there are 5 developers on the project, and this works fine on 3 dev machines. It fails on 2 and also on TeamCity. What makes this machine dependent?
Any help is appreciated.

@Daniel15
Copy link
Member

@Ajhub

What makes this machine dependent?

By default ReactJS.NET will try to use V8, and fall back to the MSIE JS engine if V8 does not initialise correctly for some reason. There's a few machine-dependent bits:

  • V8 depends on the Visual C++ 2013 runtime (msvcp120.dll and msvcr120.dll)
  • MSIE depends on the version of Internet Explorer installed

You can disable the MSIE fallback by doing .SetAllowMsieEngine(false) in your config.

@Daniel15
Copy link
Member

I was only able to replicate issues when using the "classic" MSIE engine. This engine is quite old now, so I've totally disabled it in ReactJS.NET and now only allow the newer Chakra engine.

@vincentshow - Since you mentioned that you were trying React.Sample.Mvc4, I guess you cloned the ReactJS.NET repo and compiled it? Could you please try that again and see if it works for you now?

@Daniel15
Copy link
Member

Just pushed ReactJS.NET 2.2.1 which disables the classic MSIE engine as per my comment above. Please reopen this if you still see the same error message.

@vincentshow
Copy link
Author

note that you mentioned
MSIE depends on the version of Internet Explorer installed

and i have upgraded my reactjs.net by nuget and added .SetAllowMsieEngine(false) in my config when exception occured,
i try to upgrade my ie from 9 to 11,rebuild......no exception occured and the example was ok!
as i'm in working, there's no time to downgrade ie to replicate last exception. but this is interesting,
am i missing something rules? doesn't reactjs support ie9?

@garethdhopkins
Copy link

I had this problem where it worked locally but not on our production server and where adding .SetAllowMsieEngine(false) to my config I got an error about the V8 bin files not being found. Installing Visual C++ Redistributable Packages for Visual Studio 2013 fixed the issue.

See the following SO for more information and different fixes:-
http://stackoverflow.com/questions/23301851/clearscript-files-cannot-be-found-on-host

@milianoo
Copy link

I have this issue on v2.2.1
"React.Exceptions.BabelException: Unable to get property 'split' of undefined or null reference ---> JavaScriptEngineSwitcher.Core.JsRuntimeException: Unable to get property 'split' of undefined or null reference ---> MsieJavaScriptEngine.JsRuntimeException: Unable to get property 'split' of undefined or null reference "

waacton added a commit to waacton/Japangolin that referenced this issue Mar 31, 2016
@waacton
Copy link

waacton commented Apr 5, 2016

React.Exceptions.BabelException: Unable to get property 'split' of undefined or null reference

I also had this issue in v2.2.1 after publishing to Azure server. I disabled MSIE engine fallback with .SetAllowMsieEngine(false) and got (locally and on the server):

DirectoryNotFoundException: Failed to load the ClearScriptV8 assembly, because the directory '........\ClearScript.V8' does not exist

Seems as though v2.2.1 didn't work out of the box for me - I had to copy ClearScript V8 engine binaries to the right directories (useful: http://www.samulihaverinen.com/web-development/dotnet/2016/01/19/how-to-run-clearscript-v8-javascript-engine-in-azure/).

This is all entirely new to me, so I suspect I've missed something with my environment setup somewhere?

@fehro
Copy link

fehro commented Apr 15, 2016

My current development machine is stuck using IE10 so I did what @waacton suggested above by copying the files manually to my user dnx directory and it worked. Thanks.

@WereDev
Copy link

WereDev commented May 11, 2016

I was on 2.3.0 and still had this problem when I published. It worked fine when running locally. I moved back to 2.1.2 and it's working well again.

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