Seems can't parse JSX syntax
See original GitHub issueSeems the webpack can’t parse JSX syntax. On a minimalist example I get following error in JS console:
index.js:1 Uncaught Error: Module parse failed: Unexpected token (45:2)
You may need an appropriate loader to handle this file type.
|
| render(
> <Playroom
| themes={themes}
| components={components}
at eval (index.js:1)
at Object../node_modules/playroom/src/index.js (main.js:96)
at __webpack_require__ (main.js:20)
at main.js:84
at main.js:87
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Webpack won't parse JSX no matter what I try - Stack Overflow
duplicating the .babelrc file into the main directory and entry point directory, not sure which is necessary. registering babel-register: in app ...
Read more >Why can't browsers read JSX ? - GeeksforGeeks
Browsers can't read JSX because there is no inherent implementation for the browser engines to read and understand them. JSX is not intended...
Read more >html-react-parser - npm
The parser converts an HTML string to one or more React elements. To replace an element with another element, check out the replace...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON. Message. SyntaxError: JSON.parse: unterminated string literal ...
Read more >React Without JSX
Each JSX element is just syntactic sugar for calling React.createElement(component, props, ...children) . So, anything you can do with JSX can also be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, as of v0.5.0, you no longer need to apply webpack config like @pascalduez’s example. If custom webpack config isn’t provided, your project code is now run through Babel + preset-env + preset-react.
@dburles Something in this vein should do it.