Expected behavior A clear and concise description of what you expected to
happen.
Show route content
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Seems to not work only with Vite dev. It works with vite build, when u visit builded dist html. I used useLocation() before with rollup and it was working. Then I switched to vite for its speed and it also did work. Today, I was removing and updating npm deps and it stopped working with this error. Unfortunately I wasn't able to revert to working state and detect the culprit, so I made this clean repl.
Describe the bug A clear and concise description of what the bug is.
useLocation()
hook throws errorFunction called oustide component initialization
.To Reproduce Steps to reproduce the behavior:
useLocation()
Please add a link to an example in the Svelte REPL or in a Codesandbox, if you can.
https://github.com/mataslib/uselocation-bug-repl
Expected behavior A clear and concise description of what you expected to happen.
Show route content
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Seems to not work only with Vite dev. It works with vite build, when u visit builded dist html. I used
useLocation()
before with rollup and it was working. Then I switched to vite for its speed and it also did work. Today, I was removing and updating npm deps and it stopped working with this error. Unfortunately I wasn't able to revert to working state and detect the culprit, so I made this clean repl.