django-channels icon indicating copy to clipboard operation
django-channels copied to clipboard

Critical dependency: the request of a dependency is an expression

Open shirazz opened this issue 4 years ago • 4 comments

Getting a warning while trying to use the package with NextJS. A reproducible code sample is attached here for reference.

Warning

./node_modules/django-channels/dist/index.js
Critical dependency: the request of a dependency is an expression

Screenshot image

shirazz avatar Apr 30 '20 22:04 shirazz

The issue is being discussed here in the Parcel Repo.

shirazz avatar May 02 '20 00:05 shirazz

Thank you for the report @shirazz !

I've looked ad the Parcel issue you linked, but I did not find any solution. Is there anything I can do?

fcurella avatar May 04 '20 14:05 fcurella

Unfortunately i didn't find any fix and I had to use reconnecting web socket instead of this. I was thinking of rebuilding the same using either rollup or WebPack itself. Unfortunately I am at the edge of a critical release. but once i am done, i will look into this as i have plans to use this and i am pretty sure almost all the webpack users will be facing this issue.

shirazz avatar May 04 '20 16:05 shirazz

my solution at this moment

plugins: [
    ...
    // @issue: https://github.com/channels-frontend/django-channels/issues/7
    // @solution: https://github.com/Giphy/giphy-js/issues/68
    new ContextReplacementPlugin(/\/django-channels\//, (data) => {
      delete data.dependencies[0].critical;
      return data;
    }),
   ...
  ],

km4 avatar Jun 26 '20 12:06 km4