Skip to content

Bug: webpackPrefetch performs prefetching even if the module is already preloaded #17496

Description

@FogelAI

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When using webpackPrefetch for a preloaded module, it results in an additional network request.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone the repository: https://github.com/FogelAI/webpack_prefetch_bug
  2. Run the following commands:
    $ npm i
    $ npm run start
  3. Visit http://localhost:3000/
  4. Check the network tab of the Chrome DevTools. You should see two network requests of the Module.js file.

What is the expected behavior?
The Webpack runtime should skip the webpackPrefetch if the module is already preloaded.

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
Webpack v5.88.1
Node.js v16.16.0
Operating System: Windows 7
Chrome v109

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: staleNo author response after a needs: request; close candidate

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo