Reply
Member
Posts: 2
Registered: ‎12-27-2017

Angular 2 / WebPack colors/lib/colors.js

Trying to integrate Accept.js into an Angular 2 project using WebPack.  However at compile time I get this error:

 

ARNING in ./~/colors/lib/colors.js
127:29 Critical dependency: the request of a dependency is an expression

 

and trying to run the code I get the following:

 

./~/colors/lib/colors.js
127:29 Critical dependency: the request of a dependency is an expression
Error
at CommonJsRequireContextDependency.getWarnings (C:\NRHA\nrha-web\node_modules\webpack\lib\dependencies\CommonJsRequireContextDependency.js:22:4)
at C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:640:21
at Array.forEach (native)
at C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:639:22
at Array.forEach (native)
at Compilation.reportDependencyWarnings (C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:638:9)
at Compilation.<anonymous> (C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:497:8)
at Array.forEach (native)
at Compilation.finish (C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:496:15)
at Compiler.<anonymous> (C:\NRHA\nrha-web\node_modules\webpack\lib\Compiler.js:434:15)
at C:\NRHA\nrha-web\node_modules\tapable\lib\Tapable.js:289:11
at Compilation.<anonymous> (C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:444:10)
at C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:420:12
at C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:332:10
at C:\NRHA\nrha-web\node_modules\webpack\node_modules\async\lib\async.js:52:16
at done (C:\NRHA\nrha-web\node_modules\webpack\node_modules\async\lib\async.js:246:17)
at C:\NRHA\nrha-web\node_modules\webpack\node_modules\async\lib\async.js:44:16
at C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:332:10
at C:\NRHA\nrha-web\node_modules\webpack\node_modules\async\lib\async.js:52:16
at done (C:\NRHA\nrha-web\node_modules\webpack\node_modules\async\lib\async.js:246:17)
at C:\NRHA\nrha-web\node_modules\webpack\node_modules\async\lib\async.js:44:16
at C:\NRHA\nrha-web\node_modules\webpack\lib\Compilation.js:332:10
warnings @ webpack-dev-server.js:3
l.onmessage @ webpack-dev-server.js:3
n.dispatchEvent @ webpack-dev-server.js:1
(anonymous) @ webpack-dev-server.js:2
r._transportMessage @ webpack-dev-server.js:2
r.emit @ webpack-dev-server.js:1
ws.onmessage @ webpack-dev-server.js:3
wrapFn @ zone.js:647
ZoneDelegate.invokeTask @ zone.js:236
Zone.runTask @ zone.js:136
ZoneTask.invoke @ zone.js:304

 

 

zone.js:301 [Violation] 'DOMContentLoaded' handler took 5126ms

 

zone.js:140 Uncaught TypeError: console.log is not a function
at Object.warnings (webpack:///(webpack)-dev-server/client?:40:11)
at SockJS.sock.onmessage (webpack:///(webpack)-dev-server/client?:83:24)
at SockJS.EventTarget.dispatchEvent (webpack:///./~/sockjs-client/lib/event/eventtarget.js?:51:20)
at eval (webpack:///./~/sockjs-client/lib/main.js?:274:16)
at Array.forEach (<anonymous>)
at SockJS._transportMessage (webpack:///./~/sockjs-client/lib/main.js?:272:17)
at WebSocketTransport.EventEmitter.emit (webpack:///./~/sockjs-client/lib/event/emitter.js?:50:18)
at WebSocketTransport.ws.onmessage (webpack:///./~/sockjs-client/lib/transport/websocket.js?:35:10)
at WebSocket.wrapFn [as _onmessage] (webpack:///./~/zone.js/dist/zone.js?:647:29)
at ZoneDelegate.invokeTask (webpack:///./~/zone.js/dist/zone.js?:236:37)
at Zone.runTask (webpack:///./~/zone.js/dist/zone.js?:136:47)
at WebSocket.ZoneTask.invoke (webpack:///./~/zone.js/dist/zone.js?:304:33)
warnings @ client:40
sock.onmessage @ client:83
EventTarget.dispatchEvent @ eventtarget.js:51
(anonymous) @ main.js:274
SockJS._transportMessage @ main.js:272
EventEmitter.emit @ emitter.js:50
WebSocketTransport.ws.onmessage @ websocket.js:35
wrapFn @ zone.js:647
ZoneDelegate.invokeTask @ zone.js:236
Zone.runTask @ zone.js:136
ZoneTask.invoke @ zone.js:304

 

Any help here would be greatly appreciated.  

 

  • I know I'm getting the Warning in colors.js due to the require() call in it.  However this is a dependency of winston.js to use colors.js.  Nothing we have tried or searched on found a solution for this.  Hoping someone has some ideas.
Administrator
Posts: 149
Registered: ‎03-28-2014

Re: Angular 2 / WebPack colors/lib/colors.js

This looks like more of an issue with Winston & Colors than Accept.  Also it seems like a warning only, never good of course but are you hitting an actual error?  Here's a thread that might help:  https://github.com/winstonjs/winston/issues/984

 

 

Member
Posts: 2
Registered: ‎12-27-2017

Re: Angular 2 / WebPack colors/lib/colors.js

Due to the issue with Colors, webpack is not able properly process this, and fails then to load Accept.js. 

 

Looking for any help if anyone has tried to use Accept.js  through Angular2 and WebPack.