Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.28.0
Current Behavior
After updating to the latest StencilJS version, which includes an upgrade to the latest Rollup version, Rollup no longer processes .cts files correctly. This issue affects importing functions from libphonenumber-js. The same configuration worked fine in previous StencilJS versions.
This is the debug output:
Rollup: Parse Error: ../../../node_modules/libphonenumber-js/index.d.cts:42:20
RollupError: ../../../node_modules/libphonenumber-js/index.d.cts (42:20): Expected ',', got ':' (Note that
you need plugins to import files that are not JavaScript)
at getRollupError .../node_modules/@stencil/core/compiler/stencil.js:211989:39
at ParseError2.initialise .../node_modules/@stencil/core/compiler/stencil.js:227004:29
at convertNode2 .../node_modules/@stencil/core/compiler/stencil.js:215372:8
at convertProgram2 .../node_modules/@stencil/core/compiler/stencil.js:215358:10
at _Module.setSource .../node_modules/@stencil/core/compiler/stencil.js:229401:22
at async ModuleLoader.addModuleSource .../node_modules/@stencil/core/compiler/stencil.js:231346:11
Expected Behavior
The build succeeds.
System Info
Steps to Reproduce
- Update StencilJS to the latest version, which includes the Rollup upgrade.
- Use a project with a component .tsx file that imports functions from libphonenumber-js.
- Run the StencilJS build process.
- Observe that Rollup fails to process .cts files, causing the build to break.
Code Reproduction URL
Additional Information
This issue may be the same as #6193 and may have the same solution.