liquidjs
liquidjs copied to clipboard
Critical Dependency Warning
trafficstars
I am working with NextJS 13, Material UI, and TypeScript & I am getting this warning in my VS Code Terminal Again and again.
warn - ./node_modules/liquidjs/dist/liquid.node.cjs.js
**Critical dependency: require function is used in a way in which dependencies cannot be statically extracted**
Import trace for requested module:
./node_modules/liquidjs/dist/liquid.node.cjs.js
./shared-components/ComponentA.tsx
./shared-components/ComponentB.tsx
./shared-components/ComponentC.tsx
./shared-components/ComponentD.tsx
./app/components/(dashboard-app)/dashboard/components/ComponentE.tsx
./app/component/(dashboard-app)/dashboard/ComponentF.tsx
It's related to a functionality to load partial templates via require.resolve, we'll have an option to remove this functionality in the next major release. Need more discussion on this.
There's a way to mitigate the warning from stackoverflow, add a plugin to Webpack config:
plugins: [
new ContextReplacementPlugin(/liquidjs/)
],
See a demo config here.