0

Wonder if someone can help or point me in the right direction here.

Just upgraded a C# web project from .Net Core 3.1 to .Net 6 and am getting the following error appearing multiple times in the console:

Clear-Site-Data header on 'https://localhost:44345/_framework/clear-browser-cache': Cleared data types: "cache".

The project is also using webpack to handle the CSS & Js files, page just keeps flicking with the same console error number going up.

Thanks for your time.

Chris
  • 470
  • 1
  • 10
  • 19
  • Does this help: https://stackoverflow.com/questions/54185821/clear-site-data-header-error-in-chrome-console?rq=1 – Andrew Corrigan Jan 07 '22 at 12:16
  • Sadly no, I've found what causing the issue now but don't know how to fix it. Its to do with style sheets in wwwroot. Every time I made a amendment to a style the browser refreshes with the console error and of course using webpack to watch for style changes causes the error to appear multiple times. Does anyone know of some settings in visual studio that consoles this behaviour? – Chris Jan 17 '22 at 11:45

1 Answers1

0

We I discovered whats happened and through leave my fix incase anyone else comes across this, all down to wwwroot being monitored for changes. So inside my dev webpack config I had a line of code see below:

    plugins: [
    new PurgecssPlugin({
        paths: glob.sync([`${path.resolve(__dirname, 'Views')}/**/*`, `${path.resolve(__dirname, 'wwwroot/dev')}/**/*`], { nodir: true }),
       only: ['vendors']
    })
]

Which was causing "vendors.css" to be recreated every few seconds inside wwwroot/dev why was getting Clear-Site-Data header console errors. Which I've now changed to the following to fix the issue.

plugins: [
    new webpack.DefinePlugin({
        ROOTPATH: JSON.stringify("dev")
    })
]
Dharman
  • 30,962
  • 25
  • 85
  • 135
Chris
  • 470
  • 1
  • 10
  • 19