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

Using HtmlResWebpackPlugin meet an Error #23

Open
zD98 opened this issue Aug 18, 2017 · 2 comments
Open

Using HtmlResWebpackPlugin meet an Error #23

zD98 opened this issue Aug 18, 2017 · 2 comments

Comments

@zD98
Copy link

zD98 commented Aug 18, 2017

My webpack config

new HtmlResWebpackPlugin({
      mode: 'html',
      filename: config.build.index,
      template: "index.html",
      inject: true,
      chunks: 
        {
          'app.js':{}
        }
    }),

And I meet a Error

Unhandled rejection TypeError: htmlContent.replace is not a function

I log the console.log(typeof compilation.assets[this.options.htmlFileName].source()), it is a function, but it should be a string.
So How do I fix this error

@lcxfs1991
Copy link
Owner

please tell me your webpack version.

@zD98
Copy link
Author

zD98 commented Aug 19, 2017

webpack@3.1.0
and this.options.htmlFileName's value is xxxx/dist/index.html

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