Cannot determine asset for chunk
See original GitHub issuePlease forgive me if this was already reported, however, I believe my situation to be different.
WARNING in webpack-subresource-integrity: Cannot determine asset for chunk 24, computed=“style.js”, available=style.css. Please report this full error message along…
This happens because I am extracting CSS styles from style.js
using mini-css-extract-plugin
and removing the now empty style.js
file using webpack-fix-style-only-entries
. Here is a sample Webpack configuration demonstrating the issue.
const path = require('path');
const FixStyle = require('webpack-fix-style-only-entries');
const Extract = require('mini-css-extract-plugin');
const HTML = require('html-webpack-plugin');
const SRI = require('webpack-subresource-integrity');
module.exports =
{
mode: 'production',
context: path.join(process.cwd(), 'source/'),
entry:
{
style: [ 'styles/style' ],
entry: [ 'scripts/entry' ]
},
output:
{
crossOriginLoading: 'anonymous',
chunkFilename: '[name]-[chunkhash].js',
filename: '[name]-[contenthash].js',
path: path.resolve(__dirname, 'public')
},
plugins:
[
new FixStyle(),
new Extract({ filename: '[name]-[contenthash].css' }),
new HTML
({
filename: 'index.html',
template: 'index.ejs'
}),
new SRI({ hashFuncNames: [ 'sha384' ] })
],
module:
{
rules:
[
{
test: /\.css$/,
use: [ Extract.loader, 'css-loader' ]
}
]
}
};
I am using webpack-subresource-integrity@1.3.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
WARNING in webpack-subresource-integrity: Cannot ... - GitHub
WARNING in webpack-subresource-integrity: Cannot determine asset for chunk scripts, computed="undefined", available=scripts.2b355891e0dd05f2cdd5.js. #104.
Read more >Webpack determine asset entry - Stack Overflow
Is there a way to determine which entry an asset came from? It appears that Webpack's compilation.processAssets and compliation.getAsset() don't ...
Read more >Unable to determine full chunk in Scan job #820058 ('xx.xx.xx ...
I seem to have one server that will not scan from security center and once it times out returns this error. I scanned...
Read more >Cooking Content and Creating Chunks in Unreal Engine
You can designate assets as belonging to specific chunks using the Asset Manager or using Primary Asset Labels. Both use a system of...
Read more >Static Asset Handling - Vite
Importing a static asset will return the resolved public URL when it is ... The server bundle also cannot determine the client host...
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 FreeTop 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
Top GitHub Comments
A fix for this has been released in version 1.3.4. Thanks again for the bug report and the test case.
I made a small repo that will reproduce this warning. https://github.com/jasonrm/wsi-106