https://github.com/serhii-chernenko/nuxt-cloudflare-pages-tus-server-issue
Explanation of Internal error 500 with @tus/server in Nuxt 3
https://github.com/serhii-chernenko/nuxt-cloudflare-pages-tus-server-issue
cloudflare nitro nuxt3 tus tus-js-client
Last synced: 16 days ago
JSON representation
Explanation of Internal error 500 with @tus/server in Nuxt 3
- Host: GitHub
- URL: https://github.com/serhii-chernenko/nuxt-cloudflare-pages-tus-server-issue
- Owner: serhii-chernenko
- Created: 2025-02-02T14:27:48.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-02T15:32:13.000Z (4 months ago)
- Last Synced: 2025-05-08T00:48:52.310Z (16 days ago)
- Topics: cloudflare, nitro, nuxt3, tus, tus-js-client
- Language: TypeScript
- Homepage: https://nuxt-cloudflare-pages-tus-server-issue.nuxt.dev/
- Size: 247 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Explanation of Internal error 500 with @tus/server in Nuxt 3
## General issue
`@tus/server` in Nitro server witing a Nuxt 3 app, deployed to Cloudflare pages, returns error when endpoint requested:
```
[nuxt] [request error] [unhandled] [500],Class extends value # is not a constructor or null in logs
in production logs
```
Production logs are not informative
### Guessing
Probably it just happens because Cloudflare workers don't allow to store files as in classic file system. But the error is not informative and doesn't seem as related to a filesystem issue at all.
## Additional issue
The client page is not loaded and returns the error
```
TypeError: Cannot read properties of undefined (reading 'call')
```### Solution
The reason is `tus-js-client` has to be used only for CSR. If you have
```ts
import * as tus from 'tus-js-client`
```
within a component (even with composable), it has to be only a client component. Add a suffix `.client` to the component name to load it only for CSR.