Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Creates a critical dependency when used in webpack build #453

Closed
vjpr opened this issue Aug 1, 2018 · 1 comment
Closed

Creates a critical dependency when used in webpack build #453

vjpr opened this issue Aug 1, 2018 · 1 comment

Comments

@vjpr
Copy link

vjpr commented Aug 1, 2018

apollo-link-ws which is used client-side, imports subscriptions-transport-ws.

This is in a next.js SSR app.

utf-8-validate is a native dep: https://github.com/websockets/utf-8-validate/blob/master/index.js

    WARNING in xxx/node_modules/.registry.npmjs.org/node-gyp-build/3.4.0/node_modules/node-gyp-build/index.js 13:9-32
    Critical dependency: the request of a dependency is an expression
     @ xxx/node_modules/.registry.npmjs.org/utf-8-validate/5.0.1/node_modules/utf-8-validate/index.js
     @ xxx/node_modules/.registry.npmjs.org/ws/5.2.2/node_modules/ws/lib/validation.js
     @ xxx/node_modules/.registry.npmjs.org/ws/5.2.2/node_modules/ws/lib/receiver.js
     @ xxx/node_modules/.registry.npmjs.org/ws/5.2.2/node_modules/ws/index.js
     @ xxx/node_modules/.registry.npmjs.org/subscriptions-transport-ws/0.9.14/node_modules/subscriptions-transport-ws/dist/server.js
     @ xxx/node_modules/.registry.npmjs.org/subscriptions-transport-ws/0.9.14/node_modules/subscriptions-transport-ws/dist/index.js
     @ xxx/node_modules/.registry.npmjs.org/apollo-link-ws/1.0.8/node_modules/apollo-link-ws/lib/webSocketLink.js
     @ xxx/node_modules/.registry.npmjs.org/apollo-link-ws/1.0.8/node_modules/apollo-link-ws/lib/index.js
     @ xxx/initApollo.js
     @ xxx/withData.js
     @ xxx/v1/pages/settings/devices.js
     @ ./pages/v1/settings/devices.js
     @ multi ./pages/v1/settings/devices.js
@michaelyuen
Copy link

This appears somewhat consistent with an issue I worked through, and it ended up being my webpack config. Further details here: apollographql/apollo-link#1274 (comment)

However, you're using nextjs? I have an application using nextjs that implements subscriptions with apollo-link-ws and I haven't seen this warning. Are you using a custom webpack config? Maybe you could share some of the code that implements apollo-link-ws?

@glasser glasser closed this as completed Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants