django-channels
django-channels copied to clipboard
Critical dependency: the request of a dependency is an expression
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
The issue is being discussed here in the Parcel Repo.
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?
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.
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;
}),
...
],