We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on credentials on preload for stylesheets in Chrome 84
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.
The text was updated successfully, but these errors were encountered:
crossorigin
fixed by v2.14.4
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
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.
The text was updated successfully, but these errors were encountered: