mgtitimoli / await-mutex

Promised based Javascript Mutex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`babel-runtime` as `peerDependency`

duckbrain opened this issue · comments

My application experienced a regression from 1.0.1 to 1.0.2. After looking at the diff between the two tags, I'm heavily suspecting the babel-runtime dependency based on the error message I'm getting, though I don't know how to prove this.

I posted about this issue on the Expo forums because I inadvertently updated dependencies while upgrading Expo and thought they were related.

Unable to resolve module `./$.html` from `${PROJECT_DIR}/node_modules/await-mutex/node_modules/core-js/library/modules/$.task.js`:
The module `./$.html` could not be found from `${PROJECT_DIR}/node_modules/await-mutex/node_modules/core-js/library/modules/$.task.js`.
Indeed, none of these files exist:\n\n  * `$.html`\n  * `${PROJECT_DIR}/node_modules/await-mutex/node_modules/core-js/library/modules/$.html/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`

After reverting to 1.0.1, it worked again, seemingly because it removed the babel-runtime dependency.

diff --git a/yarn.lock b/yarn.lock
index f4ff7a29..5e900d54 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -947,11 +947,9 @@ atob@^2.1.1:
   version "2.1.1"
   resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a"
 
-await-mutex@^1.0.1:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/await-mutex/-/await-mutex-1.0.2.tgz#0b2428e58f4a39415f461f9298fb47d94d0b9991"
-  dependencies:
-    babel-runtime "~6.3.0"
+await-mutex@1.0.1:
+  version "1.0.1"
+  resolved "https://registry.yarnpkg.com/await-mutex/-/await-mutex-1.0.1.tgz#fb3e714d8b74f820cfcee29f3612f4e1895185b1"
 
 awesome-phonenumber@^2.0.0:
   version "2.2.6"
@@ -1647,12 +1645,6 @@ babel-runtime@^6.0.0, babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime
     core-js "^2.4.0"
     regenerator-runtime "^0.11.0"
 
-babel-runtime@~6.3.0:
-  version "6.3.19"
-  resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.3.19.tgz#f2db696c3c8c379881e2a53665e02187074dc681"
-  dependencies:
-    core-js "^1.2.0"
-
 babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0, babel-template@^6.3.0:
   version "6.26.0"
   resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
@@ -2324,7 +2316,7 @@ copy-descriptor@^0.1.0:
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
 
-core-js@^1.0.0, core-js@^1.2.0:
+core-js@^1.0.0:
   version "1.2.7"
   resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
 

I saw that moving it from a devDependency to a dependency was a fix for #3. This issue: reactjs/react-a11y#72 (comment), suggests using a peer dependency to have the dependency included, but not cause a similar issue. I don't know that this would fix it, and I wouldn't know how to test that.