styleguidist / react-styleguidist

Isolated React component development environment with a living style guide
https://react-styleguidist.js.org/
MIT License
10.83k stars 1.44k forks source link

Module parse failed: error parsing entities/maps/xml.json #234

Closed gravitycode closed 7 years ago

gravitycode commented 7 years ago

I have a problem scanning Components that makes use of react-markdown library. I do not know very well why but try to load a json from the packages react-styleguidist/node_modules/entities/maps/xml.json

ERROR in ./~/react-styleguidist/~/entities/maps/xml.json
Module parse failed: /Applications/XAMPP/xamppfiles/htdocs/jslab/slush-generators/acceso-facturas/node_modules/react-styleguidist/node_modules/entities/maps/xml.json Unexpected token (1:6)
You may need an appropriate loader to handle this file type.
| {"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""}
| 
 @ ./~/react-styleguidist/~/entities/lib/encode.js 1:31-58
 @ ./~/react-styleguidist/~/entities/index.js
 @ ./~/react-markdown/~/commonmark/lib/common.js
 @ ./~/react-markdown/~/commonmark/lib/blocks.js
 @ ./~/react-markdown/~/commonmark/lib/index.js
 @ ./~/react-markdown/src/react-markdown.js
 @ ./src/app/pages/app/electronic/registry/electronic-registry.js
 @ ./~/react-styleguidist/loaders/styleguide.loader.js!./~/react-styleguidist/src/index.js
 @ ./~/react-styleguidist/src/index.js
 @ multi main

Im using: react-styleguidist 4.2.3 npm +2 webpack 1.13.3

Works including entities maps in my json-loader. Why i need to put explicity all node_modules dependencies in my loaders? path.join(__dirname, 'node_modules'+"/react-styleguidist/node_modules/entities/maps")

sapegin commented 7 years ago

I’m going to add a default JSON loader but it’s tricky not mess with user’s loaders.

You have to explicitly specify scope of your loaders for the same reason.