Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Critical Dependencies" Warning #30

Open
machineghost opened this issue Nov 26, 2016 · 8 comments
Open

"Critical Dependencies" Warning #30

machineghost opened this issue Nov 26, 2016 · 8 comments

Comments

@machineghost
Copy link

machineghost commented Nov 26, 2016

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
Copy link
Contributor

arunoda commented Nov 26, 2016

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

@ryancole
Copy link

ryancole commented Jan 2, 2017

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
Copy link

lanwin commented Mar 10, 2017

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
Copy link
Author

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
Copy link
Author

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
Copy link

valvic66 commented Aug 7, 2018

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
Copy link

valvic66 commented Aug 7, 2018

Any idea pls?

@valvic66
Copy link

Still no fix for the above warning?

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

No branches or pull requests

5 participants