Skip to content

SSR cannot generate assets preloading scripts (assets in resources hints) #1184

@clarkdo

Description

@clarkdo

Hi team 😸, thank you so much for providing the excellent project and support.

Currently we are working on the upgrading to Webpack4 in Nuxt, we met an issue in font preloading of SSR, the preload scripts of assets are empty (ssrContext.renderResourceHints()).

After some investigations, I found the font asset issue was caused by two reasons.

  1. Webpack module assets is null, I have opened a pr fix: module assets is in buildInfo webpack/webpack#6640 (merged)
  2. Webpack ConcatenatedModule has changed module identifier to request + additional hash, but vue-loader is still using request
    ConcatenatedModule: https://github.com/webpack/webpack/blob/master/lib/optimize/ConcatenatedModule.js#L434
    SSR plugin is using identifier which is modified by ConcatenatedModule: https://github.com/vuejs/vue/blob/dev/src/server/webpack-plugin/client.js#L46
    vue-loader is using request: https://github.com/vuejs/vue-loader/blob/master/lib/loader.js#L250

I'm not very sure the fix should be done in vue-ssr or vue-loader, so just opened issue here, we can have a discussion and figure out the solution 😸

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions