Skip to content

bug: Rollup Fails to Process .cts Files After Latest StencilJS Update #6198

Closed
@kurtinatlanta

Description

@kurtinatlanta

Prerequisites

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

https://www.google.com

Additional Information

This issue may be the same as #6193 and may have the same solution.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions