worker-plugin icon indicating copy to clipboard operation
worker-plugin copied to clipboard

No template for dependency: ConstDependency

Open 1234WoodMan opened this issue 4 years ago • 13 comments

image

1234WoodMan avatar Mar 05 '20 08:03 1234WoodMan

What version of Webpack is this? The plugin only supports version 4. My guess is you're on 3 or 5.

developit avatar Mar 09 '20 19:03 developit

I get the same error with webpack 4.42.0 /node_modules/next/dist/build/webpack/loaders/next-babel-loader.js

motiko avatar Mar 12 '20 07:03 motiko

Seems to be duplicate of #27, no?

But as I commented there, please check if you have duplicate installs of webpack under your node_modules and dedupe them. It worked for me.

SPKorhonen avatar Apr 05 '20 18:04 SPKorhonen

If anyone can provide a bit more information here that would be useful. Since this is a version incompatibility, screenshots aren't enough to figure out where the problem lies.

developit avatar May 03 '20 02:05 developit

Getting the same problem. Happens inside a project built with NextJS, webpack version is 4.28.3, nextJS version is 7.0.2. Checked node_modules, no duped webpacks there. This is all info I have so far, not sure what else I could provide

AtticusFetch avatar May 04 '20 15:05 AtticusFetch

@SPKorhonen I have the same issue you commented on https://github.com/GoogleChromeLabs/worker-plugin/issues/27 with Angular 9.

Can you explain to me how to update the Webpack versions in Angular 9 to make them equal?

I'm not seeing any versioning of webpack in package.json or in angular.json to update.

alvarovillafane avatar Jul 17 '20 04:07 alvarovillafane

I just fixed in Angular 9 updating package.json to match a single webpack version across dependencies and then doing npm dedupe as explained in https://github.com/GoogleChromeLabs/worker-plugin/issues/58#issuecomment-609464014

alvarovillafane avatar Jul 20 '20 00:07 alvarovillafane

I believe this may be fixed by 5.0.0?

developit avatar Aug 11 '20 23:08 developit

I just ran into this issue with worker-plugin 5.0.0 in a Next.js app. yarn list showed 2 different versions of webpack. Using yarn selective version resolutions solved the issue in my case.

  // package.json
  "resolutions": {
    "webpack": "4.44.2"
  }

lzear avatar Sep 22 '20 21:09 lzear

I just ran into this issue with worker-plugin 5.0.0 in a Next.js app. yarn list showed 2 different versions of webpack. Using yarn selective version resolutions solved the issue in my case.

  // package.json
  "resolutions": {
    "webpack": "4.44.2"
  }

After adding your webpack resolution, make sure to run yarn install.

thundermann avatar Mar 30 '21 16:03 thundermann

I just ran into this issue with worker-plugin 5.0.0 in a Next.js app. yarn list showed 2 different versions of webpack. Using yarn selective version resolutions solved the issue in my case.

  // package.json
  "resolutions": {
    "webpack": "4.44.2"
  }

After adding your webpack resolution, make sure to run yarn install.

I'm still seeing this error with the suggested fix using resolutions, using package versions [email protected] and [email protected]. Downgrading Next.js to 10.0.5 does work, but isn't ideal. Does anyone have other suggestions for fixes or workarounds?

nickrttn avatar Apr 16 '21 10:04 nickrttn

https://github.com/vercel/next.js/issues/21740#issuecomment-770771337:

The resolutions no longer works as Next.js has webpack 4 + 5 inline now to allow for an easy opt-in in next.config.js

At this point, I don't see any other solutions than migrating to webpack 5, which seems to work for some people (https://github.com/vercel/next.js/issues/22813).

lzear avatar Apr 18 '21 10:04 lzear

this seems to be working for us on a similar case image new webpack.ProvidePlugin({ 'L': 'leaflet', }),

gustavomick avatar Apr 02 '22 17:04 gustavomick