kadirahq / lokka

Simple JavaScript Client for GraphQL
MIT License
1.53k stars 62 forks source link

"Critical Dependencies" Warning #30

Open machineghost opened 7 years ago

machineghost commented 7 years ago

I recently tried using Lokka, and it works great (or at least it did once I solved the Webpack JSON loader problem). Thanks for making it!

However I do have a warning on the page which, while it isn't hurting anything, does seem concerning:

webpack-dev-server.js:1 ./~/encoding/lib/iconv-loader.js
Critical dependencies:
9:12-34 the request of a dependency is an expression
@ ./~/encoding/lib/iconv-loader.js 9:12-34

It has a stack trace of:

warnings    @   client?cd17:68
sock.onmessage  @   socket.js:37
EventTarget.dispatchEvent   @   eventtarget.js:51
(anonymous function)    @   main.js:274
SockJS._transportMessage    @   main.js:272
EventEmitter.emit   @   emitter.js:50
WebSocketTransport.ws.onmessage @   websocket.js:35

Do you have any idea what might be causing this, and/or how I might resolve it?

arunoda commented 7 years ago

I have also seen this before. Not sure who causes this issue.

ryancole commented 7 years ago

I too am getting this warning. I'm on Windows 10. Using Lokka with Webpack.

I believe that the error is actually from the HTTP transport module and it's dependency no node-fetch. There's an issue regarding this warning @ the node-fetch repository.

lanwin commented 7 years ago

I have this issue too and I can (or want) and fixing webpack is not an option cause I want to keep using create-react-app without eject all the webpack stuff.

machineghost commented 6 years ago

It seems like (based on the issue @ryancole linked) there is a real simple fix for this: Lokka just needs to switch from node-fetch to whatwg-fetch.

machineghost commented 6 years ago

Until that happens though, a hack fix I found (for anyone else coming across this ticket) is to add the following to the plugins section of webpack.config.js:

new webpack.IgnorePlugin(/\/iconv-loader$/)
valvic66 commented 6 years ago

I still have this in Storybook after the above mentioned solution:

WARNING in ./node_modules/encoding/lib/iconv-loader.js 9:12-34 Critical dependency: the request of a dependency is an expression @ ./node_modules/encoding/lib/iconv-loader.js @ ./node_modules/encoding/lib/encoding.js @ ./node_modules/node-fetch/lib/body.js @ ./node_modules/node-fetch/index.js @ ./node_modules/lokka-transport-http/dist/index.js @ ./node_modules/lokka-transport-http/index.js @ ./applications/elc-spp/src/views/lokka.ts @ ./applications/elc-spp/src/views/Spp.tsx @ ./applications/elc-spp/src/stories/SppStory.tsx @ ./applications/elc-spp .*Story.tsx @ ./.storybook/config.js @ multi ./node_modules/@storybook/react/dist/server/config/polyfills.js ./node_modules/@storybook/react/dist/server/config/globals.js (webpack)-hot-middleware/client.js?reload=true ./.storybook/config.js Storybook started on => http://localhost:6006/

valvic66 commented 6 years ago

Any idea pls?

valvic66 commented 5 years ago

Still no fix for the above warning?