Skip to content

bug: v5 stencil migrate writes an invalid config when extras becomes empty #7035

Done

Description

@Arul1998

Prerequisites

Stencil Version

5.0.0-rc.9

Current Behavior

stencil migrate reports success and exits 0, but leaves a stencil.config.ts that doesn't parse. The comma after namespace: 'app' is removed:

namespace: 'app'
taskQueue: 'async',

The next stencil build fails with ParseError: Unexpected token, expected ",".

Expected Behavior

extras is removed and the config is still valid.

System Info

System: node 26.3.0
Platform: windows (10.0.26300)
Stencil: 5.0.0-rc.9
TypeScript: 6.0.3
Rolldown: 1.3.3

Steps to Reproduce

  1. git clone https://gist.github.com/e585494d6fbda577716f46a9cdbeea1b.git repro && cd repro
  2. npm install
  3. npx stencil migrate
  4. npx stencil build

Code Reproduction URL

https://gist.github.com/Arul1998/e585494d6fbda577716f46a9cdbeea1b

Additional Information

cleanupEmptyExtras in enable-import-injection-default.ts and light-dom-patches.ts matches ,?\s*extras\s*:\s*\{\s*\},?, so it drops the comma on both sides. extras: { experimentalSlotFixes: true } fails the same way.

Related: extras: { enableImportInjection: true, slotChildNodesFix: true } becomes compat: { enableImportInjection: truelightDomPatches: { childNodes: true } }.

I'd like to open a PR with a fix and tests against v5.

Activity

  1. Arul1998 commented on Nov 24, 2026

    @Arul1998
    ContributorAuthor

    Correction: global-style-inject.ts has the same cleanupEmptyExtras, so three rules are affected. I have a fix with tests and will open a PR against v5.

  2. added a commit that references this issue on Nov 25, 2026
    2a75886
  3. johnjenkins commented on Nov 25, 2026

    @johnjenkins
    Contributor

    thanks again for the fix ❤️ ; it was released in 5.0.0-rc.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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