blitz-js / blitz-js/legacy-framework
Infinite loop in queries in non localhost
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
### What is the problem?
Infinite loop in queries (`useQuery`, `usePaginatedQuery`...). Problem is even present in a clean project generated by `blitz new` command, accessing from custom domain.
When using `blitz dev`, sometimes it stops after several reloads. But using `blitz build && blitz start` loop is always endless.
### Paste all your error logs here:
No errors are shown. But content is reloaded infinitely and server console show queries log. Example (in a clean `blitz new` project):
```
00:45:06.270 INFO getCurrentUser() Starting with input: null
00:45:06.273 INFO getCurrentUser() Finished: resolver:0ms serializer:1ms total:1ms
00:45:13.466 INFO getCurrentUser() Starting with input: null
00:45:13.468 INFO getCurrentUser() Finished: resolver:0ms serializer:1ms total:1ms
```
### Paste all relevant code snippets here:
Code needed to face the problem is the one generated by `blitz new` in app/pages/index.ts
### What are detailed steps to reproduce this?
1. blitz new myproject
2. cd myproject
3. blitz dev
or:
blitz build && blitz start
4. Go to http://IP:3000
### Run `blitz -v` and paste the output here:
```
blitz: 0.41.1 (global)
blitz: 0.41.1 (local)
Package manager: yarn
System:
OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (1) x64 Intel Core Processor (Haswell, no TSX)
Memory: 414.99 MB / 3.75 GB
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.18.1 - /usr/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/bin/npm
Watchman: Not Found
npmPackages:
@prisma/client: 3.3.0 => 3.3.0
blitz: 0.41.1 => 0.41.1
prisma: 3.3.0 => 3.3.0
react: alpha => 18.0.0-alpha-6bce0355c-20211031
react-dom: alpha => 18.0.0-alpha-6bce0355c-20211031
typescript: ~4.3 => 4.3.5
```
UPDATED:
- It works fine when is accessed through localhost or 127.0.0.1 addresses.
- Problem is present only when hostname is not localhost nor 127.0.01 addresses, but through another hostname instead.
- Login is not working either.
Contributor guide
Assessment
This issue has not been assessed yet.