Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No template for dependency: TemplateArgumentDependency #41

Closed
nishp1 opened this issue Feb 24, 2015 · 9 comments
Closed

Error: No template for dependency: TemplateArgumentDependency #41

nishp1 opened this issue Feb 24, 2015 · 9 comments

Comments

@nishp1
Copy link

nishp1 commented Feb 24, 2015

I am currently using webpack version 1.5.0 and karma-webpack version 1.5.3 on a project. After release of webpack version 1.6.0, I am getting the error below when running tests.

It looks like having webpack ^1.4.0 as a peerDependencies causes npm to download the latest webpack under karma-webpack's node_modules even though webpack 1.5.3 satisfies peerDependencies requirement. Any thoughts on how to avoid these issues going further?

Error: No template for dependency: TemplateArgumentDependency
  at doDep (project/node_modules/karma-webpack/node_modules/webpack/lib/NormalModule.js:115:23)
  at Array.forEach (native)
  at doBlock (project/node_modules/karma-webpack/node_modules/webpack/lib/NormalModule.js:124:22)
  at DependenciesBlock.NormalModule.source (project/node_modules/karma-webpack/node_modules/webpack/lib/NormalModule.js:156:2)
  at Tapable.ModuleTemplate.render (project/node_modules/karma-webpack/node_modules/webpack/lib/ModuleTemplate.js:14:28)
  at Tapable.Template.renderChunkModules (project/node_modules/karma-webpack/node_modules/webpack/lib/Template.js:80:31)
  at Tapable.<anonymous> (project/node_modules/karma-webpack/node_modules/webpack/lib/MainTemplate.js:28:22)
  at Tapable.applyPlugins [as applyPluginsWaterfall] (project/node_modules/karma-webpack/node_modules/webpack/node_modules/tapable/lib/Tapable.js:37:47)
  at Tapable.MainTemplate.render (project/node_modules/karma-webpack/node_modules/webpack/lib/MainTemplate.js:112:20)
  at Tapable.createChunkAssets (project/node_modules/karma-webpack/node_modules/webpack/lib/Compilation.js:783:32)
@nishp1
Copy link
Author

nishp1 commented Mar 3, 2015

Any thoughts?

Now getting following error with the upgrade of webpack to 1.7.0.

WARN [preprocess]: Can not load "webpack"!
  TypeError: Cannot read property 'filename' of null

@dennis-johnson-dev
Copy link

This seems to be our issue as well. @nishp1 Have you found a good workaround yet? cc @sokra

@nishp1
Copy link
Author

nishp1 commented May 7, 2015

I ended up upgrading webpack to latest version so that there is only version of webpack.

@idchlife
Copy link

idchlife commented May 7, 2015

Just now encountered error

/Users/myuser/www/react-test/scripts/node_modules/webpack/lib/Template.js:80
                            source.add(BalancePanel.render(module, dependencyTemplates, chunk));
                                       ^
ReferenceError: BalancePanel is not defined

When BalancePanel was my file and my class, not webpacks

I commented this

//var webpack = require('webpack');

and this

//new webpack.DefinePlugin({
//  'process.env': {
//    'NODE_ENV': JSON.stringify('production')
//  }
//})

in webpack.config.js file, also deleted webpack folder from node_modules, so exactly webpack from /usr/local/bin/webpack will be used.

Yep, I assume when using production plugin I will need to use it once and not in dev, otherwise I will end up with webpack trying to insert my classes in its source code (or I'm stupid)

@idchlife
Copy link

idchlife commented May 7, 2015

Addition. I also had to delete react and react-tools folders, after minification/stringification (or what it is), so they won't search for my class.

@eugene1g
Copy link

I had the same issue while using a global install of webpack and webpack-dev-server (current). With no other changes, it just started throwing that error one morning. I removed webpack and webpack-dev-server from global node_modules, installed both again and they worked fine again. Probably something going wrong with dependencies.

@gajus
Copy link

gajus commented Sep 11, 2015

Are you using webpack.optimize.DedupePlugin() plugin? Removing the latter plugin from my config solved the issue.

@gajus
Copy link

gajus commented Sep 11, 2015

In addition, see webpack/webpack#1082.

@joshwiens
Copy link
Contributor

Resolving as this is no longer valid in 2.2.0 and resolved for 1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants