roxiness / routify

Automated Svelte routes
https://routify.dev
1.85k stars 86 forks source link

Support svelte 5 #554

Open yairkukielka opened 1 month ago

yairkukielka commented 1 month ago

Describe the feature

Running a simple project with Vite 5 and the last version of Routify 3 I get this error in the browser

Uncaught Svelte error: svelte_component_invalid_this_value
The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined

    in DecoratorWrapper.svelte
    in ScrollDecorator.svelte
    in DecoratorWrapper.svelte
    in RenderFragment.svelte
    in ComposeFragments.svelte
    in _module.svelte
    in AnchorDecorator.svelte
    in ScrollDecorator.svelte
    in DecoratorWrapper.svelte
    in RenderFragment.svelte
    in ComposeFragments.svelte
    in AnchorDecorator.svelte
    in Router.svelte
    in App.svelte

    at svelte_component_invalid_this_value (http://localhost:5173/node_modules/.vite/deps/chunk-QS6J2F3K.js?v=3ce9e45e:375:19)
    at validate_dynamic_component (http://localhost:5173/node_modules/.vite/deps/chunk-JLOINEC6.js?v=3ce9e45e:2822:7)
    at http://localhost:5173/node_modules/.vite/deps/@roxi_routify.js?v=82f63852:2632:5
    at http://localhost:5173/node_modules/.vite/deps/chunk-JLOINEC6.js?v=3ce9e45e:1060:30
    at execute_reaction_fn (http://localhost:5173/node_modules/.vite/deps/chunk-QS6J2F3K.js?v=3ce9e45e:1560:29)
    at execute_effect (http://localhost:5173/node_modules/.vite/deps/chunk-QS6J2F3K.js?v=3ce9e45e:1681:20)
    at create_effect (http://localhost:5173/node_modules/.vite/deps/chunk-QS6J2F3K.js?v=3ce9e45e:476:7)
    at branch (http://localhost:5173/node_modules/.vite/deps/chunk-QS6J2F3K.js?v=3ce9e45e:582:10)
    at http://localhost:5173/node_modules/.vite/deps/chunk-JLOINEC6.js?v=3ce9e45e:1060:17
    at execute_reaction_fn (http://localhost:5173/node_modules/.vite/deps/chunk-QS6J2F3K.js?v=3ce9e45e:1560:29)

Examples

See reproduction repository here https://github.com/yairkukielka/routify-vitest-example/tree/svelte5 You need to be on the svelte5 branch!

Envinfo:

  System:
    OS: macOS 13.6.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 26.98 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v18.19.1/bin/npm
  npmPackages:
    @roxi/routify: ^3.0.0-next.223 => 3.0.0-next.225 
    svelte: ^5.0.0-next.136 => 5.0.0-next.136 
    vite: ^5.2.0 => 5.2.11