Skip to content
This repository has been archived by the owner on Apr 12, 2020. It is now read-only.

Incompatibility with latest version of Svelte(3.14.1) #62

Closed
c0ldra1n opened this issue Nov 15, 2019 · 6 comments
Closed

Incompatibility with latest version of Svelte(3.14.1) #62

c0ldra1n opened this issue Nov 15, 2019 · 6 comments

Comments

@c0ldra1n
Copy link

c0ldra1n commented Nov 15, 2019

To reproduce this bug, use npx degit sveltejs/template to use the latest version of Svelte with svero.

The following lines from Route.svelte was causing an error:

  $: {
    activeRouter = $routeInfo[key];
    activeProps = getProps($$props, arguments[0]['$$'].props);
  }

as arguments[0]['$$'].props was in fact an object type after several updates from Svelte.

However, on the same source, Array.prototype.forEach is used to iterate through the second argument of getProps function, so the resulting error would show that the function does not exist.

To fix, replace the line with the following or

  $: {
    activeRouter = $routeInfo[key];
    activeProps = getProps($$props, Object.keys(arguments[0]['$$'].props));
  }

add the following line within the getProps function to allow for backward compatibility.

  // prune all declared props from this component
  required = (typeof required === 'object' ? Object.keys(required) : required);
  required.forEach(k => {
    delete others[k];
  });

I've made this fix in my fork, which takes the former approach. I'd suggest the master branch to go with the latter if backward compatibility is preferred. Please look into this! Thank you.

@c0ldra1n c0ldra1n changed the title Incompatibility with latest version of svelte(3.14.1) [Bug] Incompatibility with latest version of svelte(3.14.1) Nov 15, 2019
@c0ldra1n c0ldra1n changed the title [Bug] Incompatibility with latest version of svelte(3.14.1) Incompatibility with latest version of svelte(3.14.1) Nov 15, 2019
@c0ldra1n c0ldra1n changed the title Incompatibility with latest version of svelte(3.14.1) Incompatibility with latest version of ㄴvelte(3.14.1) Nov 15, 2019
@c0ldra1n c0ldra1n changed the title Incompatibility with latest version of ㄴvelte(3.14.1) Incompatibility with latest version of Svelte(3.14.1) Nov 15, 2019
@dom3k
Copy link

dom3k commented Nov 22, 2019

Thank you very much. In version 3.15.0 I have an error:
obraz

Probably your solution will fix it.

@c0ldra1n
Copy link
Author

In fact I came across this solution while tackling that very issue. You could use @c0ldra1n/svero if you need a hotfix.

@dom3k
Copy link

dom3k commented Nov 23, 2019

Thank you very much.
Unfortunately I gave up this library.
I have encountered too many problems and errors.

I came here from https://github.com/EmilTholin/svelte-routing due "conditions" and "redirects" functionality on Route but with it I got errors too.

I heartily recommend use Page.js with Svelte. Such as for example: https://spiffy.tech/blog/a-minimal-svelte-router/
It works great for me.

@pateketrueke
Copy link
Contributor

Unfortunately I gave up this library.

@dom3k please use yrv, it already solves most problems you found on svero, and also its API is reliable and stable!

Almoullim added a commit to Almoullim/svero that referenced this issue Feb 29, 2020
@jbisgrove
Copy link

thank you. your second version fixed it. i didn't try the first one.
// prune all declared props from this component
required = (typeof required === 'object' ? Object.keys(required) : required);
required.forEach(k => {
delete others[k];
});

@kazzkiq
Copy link
Owner

kazzkiq commented Apr 12, 2020

Svero is now deprecated. Check #68 for alternatives.

@kazzkiq kazzkiq closed this as completed Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants