webpack + require handlebars error
See original GitHub issueI get the following error simply by using require handlebars.
▶ webpack --display-modules
Hash: bdb0fe35e2f8bde783e5
Version: webpack 1.12.12
Time: 116ms
Asset Size Chunks Chunk Names
bundle.main.js 2.82 kB 0 [emitted] main
[0] ./src/index.js 150 bytes {0} [built]
[1] ./~/handlebars/lib/index.js 792 bytes {0} [built] [3 warnings] [3 errors]
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
ERROR in ./~/handlebars/lib/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../dist/cjs/handlebars/compiler/printer in /home/abhisekp/MyProjects/JSApps/MadeWithLove-Webpack/node_modules/handlebars/lib
@ ./~/handlebars/lib/index.js 9:14-64
ERROR in ./~/handlebars/lib/index.js
Module not found: Error: Cannot resolve module 'fs' in /home/abhisekp/MyProjects/JSApps/MadeWithLove-Webpack/node_modules/handlebars/lib
@ ./~/handlebars/lib/index.js 17:11-24
ERROR in ./~/handlebars/lib/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../dist/cjs/handlebars in /home/abhisekp/MyProjects/JSApps/MadeWithLove-Webpack/node_modules/handlebars/lib
@ ./~/handlebars/lib/index.js 7:17-50
My index.js
var handlebars = require('handlebars');
My package.json
"dependencies": {
"handlebars": "^4.0.5"
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:27 (1 by maintainers)
Top Results From Across the Web
handlebars.js - Error loading Handlebars partial with webpack ...
Webpack Config. I am using the handlebars-loader module, and have set both the rootRelative and helperDirs options appropriately (I think!):
Read more >A Step By Step Guide To Using Handlebars With Your Node js ...
It's time for some Handlebars Yay! First off, we need to install the Handlebars dependency as follows: npm install express-handlebars --save. Then we...
Read more >handlebars-error-parser - npm
The purpose of this module is to parse the Handlebars compile exceptions messages into a more useable format which can be used in...
Read more >html-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >webpack + require handlebars error - Bountysource
I get the following error simply by using require handlebars. ▷ webpack --display-modules Hash: bdb0fe35e2f8bde783e5 Version: webpack ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got round this with …
in my webpack config
This is retarded. This
handlebarslibrary should have fixed this bug. Yet they neglect and ignore.The workaround is to replace:
with: