Skip to content

Conversation

@OS-jacobbell
Copy link
Contributor

@OS-jacobbell OS-jacobbell commented Nov 17, 2025

What is the current behavior?

A dynamic import path in src/client/client-load-module.ts can cause a warning to appear for users in Angular projects.

▲ [WARNING] The glob pattern import("./**/.entry.js") did not match any files [empty-glob]

node_modules/@stencil/core/internal/client/index.js:3808:2:
  3808 │   `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVers...
       ╵   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The warning is printed because no files are found for this path.

GitHub Issue Number: 5427

What is the new behavior?

Esbuild and Rollup docs indicate an import path containing a string literal will be evaluated at build time. An import path containing only a variable will not be evaluated. It looks like a dynamic import was the intended behavior, so this PR moves the path to a variable and removes code to work around problems in the previous approach.

Documentation

Does this introduce a breaking change?

  • Yes
  • No
  • Maybe

There are many ways to build javascript and I wouldn't be surprised if this breaks some build system out there. Also, though the current behavior seems incorrect, someone may be relying on it.

Testing

Tried these changes with the reproduction steps in the issue. No warning is printed and project builds.

Other information

Looking for community feedback: does this change follow intended behavior? Could it be incompatible with your build system?

To fix the "glob pattern" warning in issue #5427, the import path must not contain a string literal.
If this works, the code to replace MODULE_IMPORT_PREFIX is unneeded.
@OS-jacobbell OS-jacobbell changed the title Fw 6790 fix(compiler): move dynamic import path into a variable Nov 17, 2025
@OS-jacobbell OS-jacobbell marked this pull request as ready for review November 18, 2025 22:16
@OS-jacobbell OS-jacobbell requested a review from a team as a code owner November 18, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants