question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot determine asset for chunk

See original GitHub issue

Please 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jscheidcommented, Oct 1, 2019

A fix for this has been released in version 1.3.4. Thanks again for the bug report and the test case.

1reaction
jasonrmcommented, Sep 27, 2019

I made a small repo that will reproduce this warning. https://github.com/jasonrm/wsi-106

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found