Skip to content

[fix] Use dynamic require for bufferUtil and utfValidate#1757

Closed
Mike-Dax wants to merge 1 commit intowebsockets:masterfrom
Mike-Dax:master
Closed

[fix] Use dynamic require for bufferUtil and utfValidate#1757
Mike-Dax wants to merge 1 commit intowebsockets:masterfrom
Mike-Dax:master

Conversation

@Mike-Dax
Copy link

@Mike-Dax Mike-Dax commented May 7, 2020

Closes #1756

Upon attempting to require the utf-8-validate and bufferutil modules, Yarn PnP will detect the usage of a module that's not installed and error.

This replaces the requires with a dynamic require call that doesn't get caught by Yarn PnP (or other bundlers for that matter).

@lpinca
Copy link
Member

lpinca commented May 7, 2020

Thanks for the PR but I'm not a fan of this. Both bufferutil and utf-8-validate are marked as optional peer dependencies

ws/package.json

Lines 37 to 43 in 78e1c01

"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
so this issue should be solved by yarn or other bundlers, not here.

@lpinca lpinca closed this Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WS incompatible with Yarn PnP

2 participants