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

Module not found error #80

Open
abhisekp opened this issue Jan 26, 2016 · 1 comment
Open

Module not found error #80

abhisekp opened this issue Jan 26, 2016 · 1 comment

Comments

@abhisekp
Copy link

I'm using handlebars-loader and I get this error from the peer dependency handlebars package. I don't understand what I'm doing wrong and why I see the error.

ERROR in ./~/handlebars/runtime.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./dist/cjs/handlebars.runtime in /home/abhisekp/MyProjects/JSApps/MadeWithLove-Webpack/node_modules/handlebars
 @ ./~/handlebars/runtime.js 3:17-57

My package.json

"dependencies":{  
  "handlebars":"^4.0.5"
},
"devDependencies":{  
  "babel-core":"^6.4.5",
  "babel-loader":"^6.2.1",
  "babel-preset-es2015":"^6.3.13",
  "handlebars-loader":"^1.1.4",
  "webpack":"^1.12.12"
}

My webpack.config.js

{
  test: /\.h(andle)?b(ar)?s$/i,
  loader: 'handlebars'
}

My Components/Button.js

import btnTempl from './Button.hbs';

Here is the related error: handlebars-lang/handlebars.js#1174

@milewski
Copy link

milewski commented Jun 3, 2017

this is probably because you are not allowing webpack to resolve .js files

resolve: {
  extensions: ['.ts', '.tsx', '.js'], //dont forget to set .js
},

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

2 participants