Skip to content

SSR cannot generate preload scripts of assets (by ssrContext.renderResourceHints() #1185

Open
@clarkdo

Description

@clarkdo

Version

14.2.1

Reproduction link

https://github.com/nuxt/nuxt.js/blob/feat/webpack4/test/with-config.test.js#L46-L53

Steps to reproduce

Try to get preload scripts of assets in SSR resources hints by calling ssrContext.renderResourceHints()

What is expected?

Preload scripts of assets can generate successfully

What is actually happening?

Preload scripts of assets are empty


Currently we are working on the upgrading to Webpack4 in Nuxt, we met this issue in SSR font-preloading.

After some investigations, I found the 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.

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions