esnet / react-network-diagrams

Contains ESnet network mapping and circuit rendering code, as used in the ESnet portal.
http://software.es.net/react-network-diagrams
Other
196 stars 37 forks source link

react-select is a dependency (not devDependency) for installing this package #36

Open igozali opened 6 years ago

igozali commented 6 years ago

Using webpack, npm i react-network-diagrams gives me this.

ERROR in ./node_modules/react-network-diagrams/lib/components/MapEditor.js
Module not found: Error: Can't resolve 'react-select' in '/Users/xyz/project/node_modules/react-network-diagrams/lib/components'
 @ ./node_modules/react-network-diagrams/lib/components/MapEditor.js 22:19-42
 @ ./node_modules/react-network-diagrams/lib/index.js
 @ ./project/js/components/Network.js
 @ ./project/js/components/App.js
 @ ./project/js/index.js
 @ multi babel-polyfill ./project/js/index.js
sartaj10 commented 6 years ago

@igozali It's working fine on my end.

screen shot 2018-06-19 at 10 40 08 am

Also, react-select is a devDependency only, as seen in this file https://github.com/esnet/react-network-diagrams/blob/master/packages/react-network-diagrams/package.json

igozali commented 6 years ago

My bad, I wasn't being clear. Doesn't the MapEditor.js component need react-select? npm i react-network-diagrams works fine, but when I import something from 'react-network-diagrams', that's when the error message I mentioned in my initial comment shows up.

rudolph9 commented 5 years ago

I'm running into a similar issue

[ error ] /app/node_modules/react-network-diagrams/lib/components/MapEditor.js
Module not found: Can't resolve 'react-select' in '/app/node_modules/react-network-diagrams/lib/components'
ModuleNotFoundError: Module not found: Error: Can't resolve 'react-select' in '/app/node_modules/react-network-diagrams/lib/components'
    at factory.create (/app/node_modules/webpack/lib/Compilation.js:823:10)
    at factory (/app/node_modules/webpack/lib/NormalModuleFactory.js:397:22)
    at resolver (/app/node_modules/webpack/lib/NormalModuleFactory.js:130:21)
    at asyncLib.parallel (/app/node_modules/webpack/lib/NormalModuleFactory.js:224:22)
    at /app/node_modules/neo-async/async.js:2830:7
    at /app/node_modules/neo-async/async.js:6877:13
    at normalResolver.resolve (/app/node_modules/webpack/lib/NormalModuleFactory.js:214:25)
    at doResolve (/app/node_modules/enhanced-resolve/lib/Resolver.js:184:12)
    at hook.callAsync (/app/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
    at _fn0 (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at resolver.doResolve (/app/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:37:5)
    at hook.callAsync (/app/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
    at _fn0 (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at hook.callAsync (/app/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
    at _fn0 (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at resolver.doResolve (/app/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:42:38)

from my yarn.lock

react-network-diagrams@^0.8.0:
  version "0.8.0"
  resolved "https://registry.yarnpkg.com/react-network-diagrams/-/react-network-diagrams-0.8.0.tgz#945705ffca674655753a1d6c7595854da1bea88e"
  integrity sha512-qHBnE3LtMCMxsehNX44owrCrR8SzgZNYYEjfwZKruPWhBBORIQXrffzhJamPI/2P4i+hinVM9IhDkBM1ucxrbA==
  dependencies:
    babel-runtime "^6.23.0"
    d3-scale "^2.0.0"
    keymirror "^0.1.1"
    prop-types "^15.5.10"
    underscore "^1.8.3"
    victor "^1.1.0"
nmpatzios commented 4 years ago

I have same problem

ModuleNotFoundError: Module not found: Error: Can't resolve 'react-select' in '/Users/nikos.batzios/jisc/react-weather-maps/node_modules/react-network-diagrams/lib/components'

does anyone found the solution ?