Code Monkey home page Code Monkey logo

Comments (27)

harrygreen avatar harrygreen commented on June 9, 2024 5

Moving it after HtmlWebpackPlugin worked for me, but then got the more cryptic error: undefined

from critters.

tmf avatar tmf commented on June 9, 2024 5

Hi,

I ran into the same issue...

I think this is due to a change in html-webpack-plugin@next (tested with 4.0.0-beta.4): the hooks were renamed in jantimon/html-webpack-plugin#1032.

Maybe when the 4.0.0 version will be released,

tap(compilation, 'html-webpack-plugin-after-html-processing', PLUGIN_NAME, true, (htmlPluginData, callback) => {
needs to use one of these hooks: https://github.com/jantimon/html-webpack-plugin#events (maybe afterEmit?)

Solution: revert to a stable version of html-webpack-plugin.
Hope that helps.

from critters.

creage avatar creage commented on June 9, 2024 4

@developit it is very simple

new HtmlWebpackPlugin({
    filename: 'index.html',
    template: '../index.html',
    chunksSortMode: 'none'
})

and index.html has just <head> and <body> tags in it.

from critters.

prateekbh avatar prateekbh commented on June 9, 2024 3

What worked for me was the order of plugins in the plugins array. Putting crittersplugin after htmlwebpackplugin made it work for me

from critters.

andrispraulitis avatar andrispraulitis commented on June 9, 2024 1

Does this plugin require html-webpack-plugin?

from critters.

szTheory avatar szTheory commented on June 9, 2024 1

Still running into this bug.

from critters.

stevenfitzpatrick avatar stevenfitzpatrick commented on June 9, 2024

+1

from critters.

lineldcosta avatar lineldcosta commented on June 9, 2024

+1

from critters.

developit avatar developit commented on June 9, 2024

Can someone share their HtmlWebpackPlugin() plugin configuration?

from critters.

ikhudo avatar ikhudo commented on June 9, 2024

+1

from critters.

prateekbh avatar prateekbh commented on June 9, 2024

@harrygreen, any stack Trace? Which version?

from critters.

developit avatar developit commented on June 9, 2024

@tmf good catch, that's likely the issue.

from critters.

notnotgabriel avatar notnotgabriel commented on June 9, 2024

+1 I'm having the same issue here

from critters.

ilanbm avatar ilanbm commented on June 9, 2024

+1 same here

from critters.

aymenbz avatar aymenbz commented on June 9, 2024

+1 same issue

from critters.

ilanbm avatar ilanbm commented on June 9, 2024

+1 same issue

from critters.

EthianWong avatar EthianWong commented on June 9, 2024

+1 same issue

from critters.

breart avatar breart commented on June 9, 2024

Did anyone fix the issue? I've tried moving it after, using the stable version, nothing worked.

from critters.

lokmanm avatar lokmanm commented on June 9, 2024

This bug is still on tried with the latest version.

from critters.

developit avatar developit commented on June 9, 2024

Looks like we'll need to make this plugin more specific to html-webpack-plugin as of v4:
https://github.com/jantimon/html-webpack-plugin#afteremit-hook

from critters.

naiyerasif avatar naiyerasif commented on June 9, 2024

I'm getting the same error

 Could not find HTML asset.
    at E:\web\microflash\node_modules\critters-webpack-plugin\dist\critters.js:168:39
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\web\microflash\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:10:1)
    at AsyncSeriesHook.lazyCompileHook (E:\web\microflash\node_modules\tapable\lib\Hook.js:154:20)
    at E:\web\microflash\node_modules\webpack\lib\Compilation.js:1414:32
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\web\microflash\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (E:\web\microflash\node_modules\tapable\lib\Hook.js:154:20)
    at E:\web\microflash\node_modules\webpack\lib\Compilation.js:1409:36
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\web\microflash\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (E:\web\microflash\node_modules\tapable\lib\Hook.js:154:20)
    at E:\web\microflash\node_modules\webpack\lib\Compilation.js:1405:32
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\web\microflash\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (E:\web\microflash\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.seal (E:\web\microflash\node_modules\webpack\lib\Compilation.js:1342:27)
    at E:\web\microflash\node_modules\webpack\lib\Compiler.js:675:18
    at E:\web\microflash\node_modules\webpack\lib\Compilation.js:1261:4
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\web\microflash\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:29:1)

with [email protected] using the following configuration.

{
  minify: true,
  templateContent () {
    return createHTMLRenderer(projectConfig.htmlTemplate)({
      app: '<div id="app"></div>'
    })
  }
}

createHTMLRenderer is a function to generate the HTML from a template.

Environment
Node: 12.16.3
Webpack: 4.43.0

from critters.

dsacramone avatar dsacramone commented on June 9, 2024

@naiyerasif you find a solution? Running into this now too.

from critters.

naiyerasif avatar naiyerasif commented on June 9, 2024

@dsacramone Unfortunately, this became a showstopper for me and I had to revert back to puppeteer for my use case. There's an open PR #52 against this issue, but not sure if it is going anywhere.

from critters.

dmnsgn avatar dmnsgn commented on June 9, 2024

I can confirm the following PR #62 is fixing this issue for me.

from critters.

CuteShaun avatar CuteShaun commented on June 9, 2024

+1 same

Error: Could not find HTML asset.
at /app/node_modules/critters-webpack-plugin/dist/critters.js:168:39
at AsyncSeriesHook.eval [as callAsync] (<anonymous>:12:1)
at AsyncSeriesHook.lazyCompileHook (/app/node_modules/tapable/lib/Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (/app/node_modules/webpack/lib/Compilation.js:1414:32)
at _promise0.then._result0 (<anonymous>:18:1)
at process._tickCallback (internal/process/next_tick.js:68:7)

webpack: 4.44.1
node: 10.13.0

from critters.

developit avatar developit commented on June 9, 2024

This has been fixed in #84 and published as [email protected].

from critters.

hjiog avatar hjiog commented on June 9, 2024

i ran into the same issue ,and my html-webpack-plugin version is 5.5.0

from critters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.