Error on credentials on preload for stylesheets in Chrome 84

Versions
- nuxt: 2.14.3
Mode: Universal
Target: Server
- node: 14.6.0
Reproduction
when using these render settings:
render: {
compressor: false,
crossorigin: 'anonymous',
http2: {
push: true
},
resourceHints: true
},
crossorigin gets set to the link header and to the preload link in the html:


but the stylesheet itself doesn't get the crossorigin markup:

Looking through the code it seems a replace is done for all the scripts:
https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-renderer/src/renderers/ssr.js#L23
renderScripts (renderContext) {
const scripts = renderContext.renderScripts()
const { render: { crossorigin } } = this.options
if (!crossorigin) {
return scripts
}
return scripts.replace(
/<script/g,
`<script crossorigin="${crossorigin}"`
)
}
and if we add a similar one for Styles
renderStyles (renderContext) {
const styles = renderContext.renderStyles();
const { render: { crossorigin } } = this.options;
if (!crossorigin) {
return styles
}
return styles.replace(
/<link/g,
`<link crossorigin="${crossorigin}"`
)
}
and change:
https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-renderer/src/renderers/ssr.js#L147
// Inject styles
HEAD += renderContext.renderStyles()
into
// Inject styles
HEAD += this.renderStyles(renderContext);
The error goes away
Thanks for all the great work.
Error on credentials on preload for stylesheets in Chrome 84
Versions
Mode: Universal
Target: Server
Reproduction
when using these render settings:
crossorigin gets set to the link header and to the preload link in the html:

but the stylesheet itself doesn't get the crossorigin markup:

Looking through the code it seems a replace is done for all the scripts:
https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-renderer/src/renderers/ssr.js#L23
and if we add a similar one for Styles
and change:
https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-renderer/src/renderers/ssr.js#L147
into
The error goes away
Thanks for all the great work.