question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DedupePlugin fails: No template for dependency: TemplateArgumentDependency

See original GitHub issue

Hi folks,

Great job with Webpack, this framework is really helping my project to succeed. I’m using version 1.8.11 through gulp-webpack and after I’ve added react-intl in my project this problem started to happen:

Error: No template for dependency: TemplateArgumentDependency
    at doDep (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/NormalModule.js:116:23)
    at Array.forEach (native)
    at doBlock (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/NormalModule.js:125:22)
    at DependenciesBlock.NormalModule.source (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/NormalModule.js:159:2)
    at Tapable.ModuleTemplate.render (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/ModuleTemplate.js:14:28)
    at Tapable.Template.renderChunkModules (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/Template.js:80:31)
    at Tapable.<anonymous> (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/MainTemplate.js:28:22)
    at Tapable.applyPlugins [as applyPluginsWaterfall] (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/node_modules/tapable/lib/Tapable.js:37:47)
    at Tapable.MainTemplate.render (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/MainTemplate.js:111:20)
    at Tapable.createChunkAssets (/Users/alansouza/project-workspace/project/node_modules/gulp-webpack/node_modules/webpack/lib/Compilation.js:784:32)

After some investigation and checking out some suggestions in the webpack Gitter chat, I decided to remove the Dedupe Plugin and then everything works again, but my bundle size has increased significantly.

Any ideas on how to make the DedupePlugin work again? If I get any pointers I could try to solve the issue myself. Any help here is much appreciated.

Alan

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:24 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
triboucommented, Feb 27, 2016

Thanks!

For anyone encountering this in the future, the comment referenced above says:

Error: No template for dependency: TemplateArgumentDependency happens when you have multiple webpack copies installed and used the DedupePlugin from a different copy.

I was using a serverless-webpack-plugin which had it’s own webpack dependency it was using to bundle files. However, I had manually installed and required webpack in my project’s webpack config as well (like you normally would with webpack). Consequently, when I removed my explicitly installed version of webpack with npm rm --save-dev webpack, the plugin was able to require it’s own scoped webpack dependency instead which worked.

I’ll alert the serverless-webpack-plugin repo to this issue to figure out how to make it easier to use in the future.

2reactions
caccialdocommented, Sep 28, 2015

rm -rf node_modules && npm i solved the issue. Please ignore my previous message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack: ChunkRenderError: No template for dependency
Update: I made my webpack 2 changes in Phenomic and setup the default project. It seems to build (with some CSS issues), so...
Read more >
webpack/webpack - Gitter
Still stuck with the error - Error: No template for dependency: TemplateArgumentDependency . This happens when I include dedupe plugin.. Tobias Koppers.
Read more >
Discussion of No template for dependency: "ConstDependency"
It seems that this error is caused by local install of package webpack under @angular-devkit when there is also an independent install under ......
Read more >
To v5 from v4 - webpack
Upgrade webpack 4 and its plugins/loaders · Make sure your build has no errors or warnings · Make sure to use mode ·...
Read more >
webpack @ 4.0.0-alpha.0 .. 4.0.0-alpha.1 - Package Diff
console.log("Invalid plugin arguments " + name + " (" + e + ")."); ... console.error("No configuration file found and no output filename configured...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found