-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Vite gives "Error: Function called outside component initialization" when used with Routify, only in Dev Build Mode #2647
Comments
Seems that your reproduce repo is invalid:
|
The file gets created upon using or |
Production build works great, but the dev build fails. |
P.S. I moved the problem code to another branch, so that I can use the working part of the repo. Branch: |
Hey the issue was because of a space in parent folder name. |
@abhijit-kar So is it solved? Should I close this issue? |
This issue is tracked here #2585, and there is a PR already to fix it |
Adding routify, urql, & having space in folder caused the issue. So after going through several reddit threads, git issues, I deduced that: Removing space in enclosing folder of the project &
Solves the issue. |
Describe the bug
I love Routify, and am able to use it with Rollup without issues. See: Quiller Bee & Quiller Bee Repo.
However, since Rollup is slow, I decided to use Vite.
After integrating Routify, the production build works great, but the Dev build gives error. See Vitte Repo: vite-routify-issue branch.
And I really need the speed of dev build with Vite & especially the HMR support.
Reproduction
Problem Repo: vite-routify-issue branch
npm run build
& thennpm run serve
(It will work)npm run dev:routify
(It will fail).System Info
vite
version: 2.1.0P.S. I am going to write a blog post about Vite + Routify in my blog Derpy Coder and replace my Rollup based dev env. So I need this to work. 🙃
The text was updated successfully, but these errors were encountered: