liquidjs icon indicating copy to clipboard operation
liquidjs copied to clipboard

Critical Dependency Warning

Open Maanil-Verma-WIN opened this issue 2 years ago • 1 comments
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

Maanil-Verma-WIN avatar Jul 02 '23 09:07 Maanil-Verma-WIN

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.

harttle avatar Jul 02 '23 14:07 harttle