Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error replacing tree: The children of the old and new trees were expected to have the same count" on migration of AccordionItem #3143

Closed
DJMogens opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@DJMogens
Copy link

Current Behavior

When migrating with

npx @skeletonlabs/skeleton-cli migrate skeleton-3

This error appears

◇  Successfully migrated app.html!
│
■  Failed to migrate src/routes/users/+page.svelte: Manipulation error: A syntax error was inserted.

FOyV3sWcRSVlb-BZ1tai2.ts:5:21 - error TS1005: ',' expected.

5   import { Accordion.Item } from '@skeletonlabs/skeleton-svelte';
                      ~

Error replacing tree: The children of the old and new trees were expected to have the same count (1:3).

-- Details --
Path: /FOyV3sWcRSVlb-BZ1tai2.ts
Text: "...port type { User } from '$lib/types';\r\n  import { Accordion } from '@skeletonlabs/skeleton-svelte';\r\n  import { Accordion.Item } from '@skeletonlabs/skeleton-svelte';\r\n  import { Avatar } from '@skeletonlabs/skeleton';\r\n  import { getModalStore } from '@skeletonlabs/..."
Stack: Error: Error replacing tree: The children of the old and new trees were expected to have the same count (1:3).
    at #handleChildren (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1469:19)
    at ParentFinderReplacementNodeHandler.handleNode (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1463:33)
    at ParentFinderReplacementNodeHandler.handleNode (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1620:19)
    at NodeHandlerHelper.handleForValues (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1404:21)
    at #handleChildren (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1473:25)
    at ParentFinderReplacementNodeHandler.handleNode (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1463:33)
    at ParentFinderReplacementNodeHandler.handleNode (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1620:19)
    at NodeHandlerHelper.handleForValues (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1404:21)
    at #handleChildren (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1473:25)
    at ParentFinderReplacementNodeHandler.handleNode (C:\Users\dani7\AppData\Local\npm-cache\_npx\eb824a1564de2b6d\node_modules\ts-morph\dist\ts-morph.js:1463:33)
│
└  Migration canceled, nothing written to disk

Expected Behavior

The expected behavior is to sucessfully migrate the accordionItem

Steps To Reproduce

Make a component in svelte with the import:

  import { AccordionItem } from '@skeletonlabs/skeleton';

Then run the migration cli

npx @skeletonlabs/skeleton-cli migrate skeleton-3

Link to Reproduction / Stackblitz

No response

More Information

The import it fails on in our project is

  import {
    Accordion,
    AccordionItem,
    Avatar,
    getModalStore,
    type ModalComponent,
    type ModalSettings
  } from '@skeletonlabs/skeleton';

But it is also tested with an individual import statement like:

  import { AccordionItem } from '@skeletonlabs/skeleton';

And the same error appears

@DJMogens DJMogens added the bug Something isn't working label Jan 23, 2025
@Hugos68
Copy link
Contributor

Hugos68 commented Jan 23, 2025

Closed by #3144

@Hugos68 Hugos68 closed this as completed Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants