markdown-js icon indicating copy to clipboard operation
markdown-js copied to clipboard

Unable to resolve module `util`

Open shangxinbo opened this issue 7 years ago • 4 comments

I run it in react-native project. maybe markdown is used for node ,and can't used by webpack.I know util is a module of node. error like this

The development server returned response error code: 500

URL: http://10.111.23.190:19001/node_modules/react-native-scripts/build/bin/crna-entry.bundle?platform=android&dev=true&strict=false&minify=false&hot=true&assetPlugin=expo/tools/hashAssetFiles

Body: {"from":"D:\github\treering-mobile\node_modules\markdown\lib\markdown.js","to":"util","message":"Unable to resolve module util from D:\\github\\treering-mobile\\node_modules\\markdown\\lib\\markdown.js: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]} processBundleResult BundleDownloader.java:172 access$100 BundleDownloader.java:38 execute BundleDownloader.java:108 emitChunk MultipartStreamReader.java:69 readAllParts MultipartStreamReader.java:116 onResponse BundleDownloader.java:96 execute RealCall.java:126 run NamedRunnable.java:32 runWorker ThreadPoolExecutor.java:1112 run ThreadPoolExecutor.java:587 run Thread.java:841

shangxinbo avatar Aug 15 '17 04:08 shangxinbo

@shangxinbo I had the same issue in my react-native project. This is a just workaround but it works for my case.

npm install util

ref: https://github.com/facebook/react-native/issues/526

satotake avatar Sep 07 '17 14:09 satotake

npm install util - solved the first problem but know it shows -> "Can't find variable buffer" :(

rfdc avatar May 16 '18 05:05 rfdc

@rfdc I've the same issue, "Can't find variable buffer". Can you find any solution?

tlofano avatar May 18 '18 17:05 tlofano

@tlofano I kind of quit and doing something else atm until it is fixed - which is pretty annoying. But I have opened an Issue Case and the plugin contributors posted some work around but not a solution https://github.com/aws/aws-amplify/issues/840 Hope that helps, let me know how you go on my link pls Cheers Raf

rfdc avatar May 19 '18 01:05 rfdc