Comments (27)
Moving it after HtmlWebpackPlugin
worked for me, but then got the more cryptic error: undefined
from critters.
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,
Line 116 in 8e9e9c0
afterEmit
?)
Solution: revert to a stable version of html-webpack-plugin
.
Hope that helps.
from critters.
@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.
What worked for me was the order of plugins in the plugins array. Putting crittersplugin after htmlwebpackplugin made it work for me
from critters.
Does this plugin require html-webpack-plugin?
from critters.
Still running into this bug.
from critters.
+1
from critters.
+1
from critters.
Can someone share their HtmlWebpackPlugin()
plugin configuration?
from critters.
+1
from critters.
@harrygreen, any stack Trace? Which version?
from critters.
@tmf good catch, that's likely the issue.
from critters.
+1 I'm having the same issue here
from critters.
+1 same here
from critters.
+1 same issue
from critters.
+1 same issue
from critters.
+1 same issue
from critters.
Did anyone fix the issue? I've tried moving it after, using the stable version, nothing worked.
from critters.
This bug is still on tried with the latest version.
from critters.
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.
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.
@naiyerasif you find a solution? Running into this now too.
from critters.
@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.
I can confirm the following PR #62 is fixing this issue for me.
from critters.
+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.
This has been fixed in #84 and published as [email protected].
from critters.
i ran into the same issue ,and my html-webpack-plugin version is 5.5.0
from critters.
Related Issues (20)
- Unable to locate stylesheet HOT 4
- Branching webpack versions
- `pruneSource: true` not pruning files
- Non-critical rules are erased from inline styles HOT 6
- Local font source is not recognized as valid
- relative urls within css
- Allow attributes to be set on generated style tag for CSP
- How to use critters in next.js v13 HOT 2
- critters de-encodes html entities HOT 1
- Parse include/exclude markers with @preserve or /*! hints
- Cannot read properties of undefined (reading 'setAttribute') HOT 6
- Disable font-face exclusion
- The `allowRules` option is missing in the types and documentation
- Passing includeSelectors config HOT 2
- Add the option of a prefix path
- Used css attribute selector gets removed by critters
- Feature Request: Expose method `processCss` which returns inlined css only
- Simple Example fails
- Building Angular 17.1 with Angular CLI when using Bootstrap 5.3.2 results in Critical CSS Inlining failing because 2 rules are skipped due to selector errors HOT 9
- 2 different lock files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from critters.