diff --git a/CHANGELOG.md b/CHANGELOG.md index 542bfba..b190983 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [unreleased] +## [2.0.10] - 2019-05-31 + +- [#1690](https://github.com/teambit/bit/issues/1690) fix error "Cannot read property 'find' of undefined" with typescript files + ## [2.0.9] - 2019-05-31 - [#1665](https://github.com/teambit/bit/issues/1665) fix resolve-modules prefix with tilda diff --git a/package.json b/package.json index 4055f98..23a736e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bit-javascript", - "version": "2.0.9", + "version": "2.0.10", "scripts": { "flow": "flow; test $? -eq 0 -o $? -eq 2", "lint": "eslint src && flow check || true", diff --git a/src/dependency-builder/detectives/detective-typescript/index.js b/src/dependency-builder/detectives/detective-typescript/index.js index 3df9497..496bebe 100644 --- a/src/dependency-builder/detectives/detective-typescript/index.js +++ b/src/dependency-builder/detectives/detective-typescript/index.js @@ -32,6 +32,7 @@ module.exports = function (src, options = {}) { }; const addExportedToImportSpecifier = (name) => { Object.keys(dependencies).forEach((dependency) => { + if (!dependencies[dependency].importSpecifiers) return; const specifier = dependencies[dependency].importSpecifiers.find(i => i.name === name); if (specifier) specifier.exported = true; }); diff --git a/src/dependency-builder/detectives/detective-typescript/index.spec.js b/src/dependency-builder/detectives/detective-typescript/index.spec.js index d464371..0d13ba1 100644 --- a/src/dependency-builder/detectives/detective-typescript/index.spec.js +++ b/src/dependency-builder/detectives/detective-typescript/index.spec.js @@ -113,4 +113,10 @@ describe('detective-typescript', () => { detective("import foo from 'foo'; var baz = bar;"); }); }); + + it('does not throw with empty import and export', () => { + assert.doesNotThrow(() => { + detective("import './layout.scss'; export default something;"); + }); + }); });