We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec3d9e9 commit 5d50b03Copy full SHA for 5d50b03
packages/vite/src/node/server/middlewares/transform.ts
@@ -53,7 +53,10 @@ export function cachedTransformMiddleware(
53
const ifNoneMatch = req.headers['if-none-match']
54
if (ifNoneMatch) {
55
const moduleByEtag = environment.moduleGraph.getModuleByEtag(ifNoneMatch)
56
- if (moduleByEtag?.transformResult?.etag === ifNoneMatch) {
+ if (
57
+ moduleByEtag?.transformResult?.etag === ifNoneMatch &&
58
+ moduleByEtag?.url === req.url
59
+ ) {
60
// For CSS requests, if the same CSS file is imported in a module,
61
// the browser sends the request for the direct CSS request with the etag
62
// from the imported CSS module. We ignore the etag in this case.
0 commit comments