GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Virtual module with shared ModuleFederation breaks build · Issue #20388 · webpack/webpack

Virtual module with shared ModuleFederation breaks build #20388

New issue
Copy link
New issue
Copy link
Closed
Bug
#20390
Closed
Virtual module with shared ModuleFederation breaks build#20388
Bug
#20390
Copy link
Assignees
xiaoxiaojx
Labels
help wantedMaintainers welcome a community PR for this

Description

@kholstinin
kholstinin
opened on Jan 30, 2026
Issue body actions

Bug Description

Using VirtualUrlPlugin with a module that is supposed to be included in a shared chunk of ModuleFederation causes the build to fail

switch (maybePath.length) {
                          ^

TypeError: Cannot read properties of undefined (reading 'length')
    at getType (/Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/util/path.js:52:20)
    at join (/Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/util/path.js:161:10)
    at cachedJoin (/Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/util/path.js:198:15)
    at Resolver.join (/Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/Resolver.js:787:10)
    at /Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js:42:18
    at Array.map (<anonymous>)
    at /Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js:41:25
    at Array.map (<anonymous>)
    at /Users/d.kholstinin/projects/virtual-mf/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js:40:14
    at _next0 (eval at create (/Users/d.kholstinin/projects/virtual-mf/node_modules/tapable/lib/HookCodeFactory.js:31:10), <anonymous>:8:1

Link to Minimal Reproduction and step to reproduce

https://github.com/kholstinin/virtual-mf-bug/tree/main

Steps:

  1. Run npm i
  2. Run npm run build
  3. See error in console

Expected Behavior

Build finished successfully

Actual Behavior

Build failed

Environment

System:
    OS: macOS 26.2
    CPU: (12) arm64 Apple M3 Pro
    Memory: 823.27 MB / 36.00 GB
  Binaries:
    Node: 24.11.1 - /Users/d.kholstinin/.nvm/versions/node/v24.11.1/bin/node
    Yarn: 1.22.22 - /Users/d.kholstinin/.nvm/versions/node/v24.11.1/bin/yarn
    npm: 11.6.2 - /Users/d.kholstinin/.nvm/versions/node/v24.11.1/bin/npm
    pnpm: 10.24.0 - /Users/d.kholstinin/.nvm/versions/node/v24.11.1/bin/pnpm
  Browsers:
    Chrome: 144.0.7559.110
    Firefox: 144.0
    Safari: 26.2
  Packages:
    webpack: ^5.104.1 => 5.104.1 
    webpack-cli: ^6.0.1 => 6.0.1

Is this a regression?

None

Last Working Version

No response

Additional Context

No response

Reacted by SuperOleg39 and Xiao

Activity

  1. alexander-akait
    added the
    Bug
    issue type on Jan 30, 2026
  2. alexander-akait
    added
    help wantedMaintainers welcome a community PR for this
    on Jan 30, 2026
  3. xiaoxiaojx
    self-assigned this
    on Jan 30, 2026
  4. alexander-akait
    closed this as completedin #20390on Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @xiaoxiaojx
    xiaoxiaojx

Labels

help wantedMaintainers welcome a community PR for this

Type

Bug

Fields

Priority

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.