aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/sol-compiler/package.json1
-rw-r--r--packages/sol-compiler/src/cli.ts1
-rw-r--r--packages/sol-resolver/CHANGELOG.json4
-rw-r--r--packages/sol-resolver/src/resolvers/npm_resolver.ts2
4 files changed, 7 insertions, 1 deletions
diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json
index fcf9775c1..7eaff360f 100644
--- a/packages/sol-compiler/package.json
+++ b/packages/sol-compiler/package.json
@@ -92,6 +92,7 @@
"require-from-string": "^2.0.1",
"semver": "5.5.0",
"solc": "^0.4.23",
+ "source-map-support": "^0.5.0",
"web3-eth-abi": "^1.0.0-beta.24",
"yargs": "^10.0.3"
},
diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts
index 8901c0a31..83dadc7ca 100644
--- a/packages/sol-compiler/src/cli.ts
+++ b/packages/sol-compiler/src/cli.ts
@@ -3,6 +3,7 @@
import { logUtils } from '@0xproject/utils';
import * as _ from 'lodash';
+import 'source-map-support/register';
import * as yargs from 'yargs';
import { Compiler } from './compiler';
diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json
index abce53d09..dd9cb3f5d 100644
--- a/packages/sol-resolver/CHANGELOG.json
+++ b/packages/sol-resolver/CHANGELOG.json
@@ -5,6 +5,10 @@
{
"note": "Fix a bug where RelativeFSResolver would crash when trying to read a directory",
"pr": 909
+ },
+ {
+ "note": "Fix a bug where NpmResolver would crash when trying to read a directory",
+ "pr": 961
}
]
},
diff --git a/packages/sol-resolver/src/resolvers/npm_resolver.ts b/packages/sol-resolver/src/resolvers/npm_resolver.ts
index 9f8617145..a2df0dcad 100644
--- a/packages/sol-resolver/src/resolvers/npm_resolver.ts
+++ b/packages/sol-resolver/src/resolvers/npm_resolver.ts
@@ -19,7 +19,7 @@ export class NPMResolver extends Resolver {
const ROOT_PATH = '/';
while (currentPath !== ROOT_PATH) {
const lookupPath = path.join(currentPath, 'node_modules', packageName, pathWithinPackage);
- if (fs.existsSync(lookupPath)) {
+ if (fs.existsSync(lookupPath) && fs.lstatSync(lookupPath).isFile()) {
const fileContent = fs.readFileSync(lookupPath).toString();
return {
source: fileContent,