Skip to content

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

@FogelAI

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy