Skip to content

Commit

Permalink
fix: add base64-arraybuffer as prod dependency
Browse files Browse the repository at this point in the history
The dependency was previously only listed as dev dependency, so that it
was not included when installing the server (the "engine.io" package,
which does not require it) and was explicitly included by the client
(the "engine.io-client" package, which needs it for the browser build).

But it failed with yarn v2, due to its stricter package boundaries:

> ERROR in ../../../.yarn/cache/engine.io-parser-npm-4.0.1-6bdb879e8a-3b71ef8b5a.zip/node_modules/engine.io-parser/lib/decodePacket.browser.js 7:18-47
> Module not found: Error: engine.io-parser tried to access base64-arraybuffer, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

> Required package: base64-arraybuffer (via "base64-arraybuffer")
> Required by: engine.io-parser@npm:4.0.1 (via xxx/.yarn/cache/engine.io-parser-npm-4.0.1-6bdb879e8a-3b71ef8b5a.zip/node_modules/engine.io-parser/lib/)

Related:

- https://dev.to/arcanis/introducing-yarn-2-4eh1#strict-package-boundaries
- #116
  • Loading branch information
darrachequesne committed Dec 7, 2020
1 parent b26993e commit 2ccdeb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@babel/preset-env": "~7.9.6",
"babel-eslint": "^10.0.3",
"babelify": "^10.0.0",
"base64-arraybuffer": "0.1.5",
"benchmark": "^2.1.4",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
Expand All @@ -22,7 +21,9 @@
"zuul": "3.11.1",
"zuul-ngrok": "4.0.0"
},
"dependencies": {},
"dependencies": {
"base64-arraybuffer": "0.1.4"
},
"scripts": {
"test": "npm run lint && npm run format:check && if test \"$BROWSERS\" = \"1\" ; then npm run test:browser; else npm run test:node; fi",
"test:node": "nyc mocha test/index.js",
Expand Down

0 comments on commit 2ccdeb2

Please sign in to comment.