Can't resolve 'bufferutil' and 'utf-8-validate'
See original GitHub issueon netlify-lambda build
WARNING in /home/nicky/projects/jason-api/node_modules/subscriptions-transport-ws/node_modules/ws/lib/buffer-util.js
not found: Error: Can't resolve 'bufferutil' in '/home/nicky/projects/jason-api/node_modules/subscriptions-transport-ws/node_modules/ws/lib'
WARNING in /home/nicky/projects/jason-api/node_modules/subscriptions-transport-ws/node_modules/ws/lib/validation.js
not found: Error: Can't resolve 'utf-8-validate' in '/home/nicky/projects/jason-api/node_modules/subscriptions-transport-ws/node_modules/ws/lib'
Despite those errors, ./netlify/functions/graphql still works locally after running netlify-lambda serve
The repo I’m having this issue in is also the mininal reproduction https://github.com/NickyMeuleman/jason-api
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
utf-8-validate - npm
Check if a buffer contains valid UTF-8. Latest version: 5.0.10, last published: 2 months ago. Start using utf-8-validate in your project by ...
Read more >Warnings when building backend Express/WS Node app with ...
The short answer. webpack can work with node, but it cannot extract follow require() statements. Modifications have to be made to ignore ...
Read more >Usage with bundlers | Socket.IO
Note: bufferutil and utf-8-validate are two optional dependencies from the ws package. You can also set them as "external" with:.
Read more >Error installing from npm: socket.io-client. Unable to resolve ...
Unable to resolve some modules: "bufferutil" in /Users/admin/Desktop/x/node_modules/ws/lib/BufferUtil.js (web.browser) "utf-8-validate" in ...
Read more >fixing warnings when bundling Colyseus server with webpack
node_modules/colyseus/node_modules/ws/lib/buffer-util.js Module not found: ... Module not found: Error: Can't resolve 'utf-8-validate' in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This can be solved by configuring your webpack externals:
However, imho it is more reasonable to have this set up by default so there’s no hassle with a custom webpack config when setting up a graphql lambda.
@sw-yx Any thoughts or objections on having this config by default? I’d be happy to open a PR adding it!
The solution for me was add this ti my
next.config.js:I’m using Next 12.1.5