Comments (9)
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.
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.
@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.
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.
Same here, getting HTTP 500 (Unable to generate source map) in chrome...
from react.net.
@ashic Installing React.JavaScriptEngine.ClearScriptV8
should be sufficient to force V8.
from react.net.
Yep installing ClearScriptV8 fixed it for me...
from react.net.
+1. Installed React.JavaScriptEngine.ClearScriptV8 via nuget to my MVC project and the 500 errors went away. Thanks!
from react.net.
Closing this out since V8 (ClearScript / VroomJs) is bundled by default now.
from react.net.
Related Issues (20)
- Fix deployment of site HOT 1
- Support the new React 18 root API HOT 2
- How to config webpack + ts .NET 6 to use dependencies + how to debug?
- `AddScriptWithoutTransform` not working correctly on Linux HOT 2
- Add ability to skip adding component to the list of components for @Html.React or @Html.ReactWithInit
- [Feature request] Ability to add attributes to root element HOT 1
- app.UseReact Could not load file or assembly 'react.js, Culture=neutral, PublicKeyToken=null'.
- ReactScriptLoadException: Error while loading "/dist/vendor.8435dc72.js": ReferenceError: 'TextEncoder' is not defined HOT 1
- ReferenceError: TextEncoder is not defined HOT 7
- More push as official framework
- Maintenance mode
- Support for React v18 HOT 2
- Replace Newtonsoft serializer dependencies with System.Text.Json.JsonSerializer
- get_CommonJSManager does not have an implementation HOT 1
- Which react version is being used by reactjs HOT 1
- code is not working date ,title,amount is not defined error is showing but it is already defined
- Can I help? HOT 4
- JSX files not in JS folder in browser in production ENV
- Use ContentRootPath if WebRootPath is null to find the full path
- Tutorial.jsx file is not found - Status 500
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.net.