We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
ejs@3 fails to build with the error "Cannot read property 'forEach' of undefined". The repository is here.
No error occurs when using [email protected]. (The example is here)
const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') module.exports = { mode: process.env.NODE_ENV || 'development', entry: { index: path.resolve(process.cwd(), './src/ejs/index.ejs') }, output : { filename: '[name].html', path: path.resolve(process.cwd(), './dist') }, module: { rules: [ { test: /\.ejs$/, use: [ 'html-loader', { loader: 'ejs-html-loader', options: { title: 'ejs-html-loader Example' } } ] } ] }, plugins : [ new HtmlWebpackPlugin({ filename : 'index.html', template : path.resolve(process.cwd(), './src/ejs/index.ejs') }) ] }
yarn build yarn run v1.17.3 $ NODE_ENV=production webpack Hash: a9250b2383821e3dda42 Version: webpack 4.42.1 Time: 283ms Built at: 2020-04-16 1:50:55 PM 1 asset Entrypoint index = index.html [0] ./src/ejs/index.ejs 58 bytes {0} [built] [1 error] ERROR in ./src/ejs/index.ejs Module Error (from ./node_modules/ejs-html-loader/lib/index.js): (Emitted value instead of an instance of Error) ejs-html-loader Cannot read property 'forEach' of undefined Child HtmlWebpackCompiler: 1 asset Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0 [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/ejs/index.ejs 58 bytes {0} [built] [1 error] ERROR in ./src/ejs/index.ejs (./node_modules/html-webpack-plugin/lib/loader.js!./src/ejs/index.ejs) Module Error (from ./node_modules/ejs-html-loader/lib/index.js): (Emitted value instead of an instance of Error) ejs-html-loader Cannot read property 'forEach' of undefined error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Maybe the return value of the compile function has changed from ejs@3 and deps is no array.
compile
deps
https://github.com/mcmath/ejs-html-loader/blob/master/src/render.js#L9
The text was updated successfully, but these errors were encountered:
I have a same probrem.
This is due to this commit. mde/ejs@12beb5c
Please remove to return deps like my pullrequest.
(I'm sorry, my English is not good.)
Sorry, something went wrong.
Same issue here.
This issue is not resolved yet. Please take a look at it.
I have fixed it in my repository. https://github.com/bananacoffee/ejs-html-loader
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Overview
ejs@3 fails to build with the error "Cannot read property 'forEach' of undefined".
The repository is here.
No error occurs when using [email protected]. (The example is here)
Package Version
webpack.config.js
Error
Expected cause
Maybe the return value of the
compile
function has changed from ejs@3 anddeps
is no array.https://github.com/mcmath/ejs-html-loader/blob/master/src/render.js#L9
The text was updated successfully, but these errors were encountered: