Giter Site home page Giter Site logo

Comments (9)

Daniel15 avatar Daniel15 commented on May 13, 2024

This is expected, the older MSIE engine can't generate source maps. The source map code in JSXTransformer has this comment above it:

// The source-map library relies on Object.defineProperty, but IE8 doesn't
// support it fully even with es5-sham. Indeed, es5-sham's defineProperty
// throws when Object.prototype.__defineGetter__ is missing, so we skip building
// the source map in that case.

JSXHandler tries the best it can to generate source maps.

I had to intentionally disable ChakraJsRt since its stack size was too small to handle transforming JSX and it kept throwing stack overflow errors. You can try to re-enable it here: https://github.com/reactjs/React.NET/blob/master/src/React/AssemblyRegistration.cs#L44-54

Besides, I think when send transformed JSX, it should check if it can generate source map before set the JSX header.

This is a good idea, I could probably just do a basic check based on the current engine - Enable it for everything except MSIE.

from react.net.

Daniel15 avatar Daniel15 commented on May 13, 2024

Also you can use the V8 engine (via React.JavaScriptEngine.ClearScriptV8 on Windows or React.JavaScriptEngine.VroomJs on Linux/Mac) which also supports source maps.

from react.net.

lijunle avatar lijunle commented on May 13, 2024

@Daniel15 thanks for you advise. I may change to V8 if it is great. Besides, I have sent a PR to disable source map if it is MSIE which I have tested locally. Please take a look.

from react.net.

ashic avatar ashic commented on May 13, 2024

Is there a way to force V8 (or disabling sourcemaps for MSIE)? I couldn't find a way to specify the engine.

from react.net.

domenu avatar domenu commented on May 13, 2024

Same here, getting HTTP 500 (Unable to generate source map) in chrome...

from react.net.

Daniel15 avatar Daniel15 commented on May 13, 2024

@ashic Installing React.JavaScriptEngine.ClearScriptV8 should be sufficient to force V8.

from react.net.

daniellmb avatar daniellmb commented on May 13, 2024

Yep installing ClearScriptV8 fixed it for me...

from react.net.

evenkiel avatar evenkiel commented on May 13, 2024

+1. Installed React.JavaScriptEngine.ClearScriptV8 via nuget to my MVC project and the 500 errors went away. Thanks!

from react.net.

Daniel15 avatar Daniel15 commented on May 13, 2024

Closing this out since V8 (ClearScript / VroomJs) is bundled by default now.

from react.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.