Skip to content
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

TypeError: Cannot convert argument to a ByteString because the character at index 12 has a value of 1506 which is greater than 255. #758

Open
moshe5745 opened this issue Jan 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@moshe5745
Copy link

moshe5745 commented Jan 16, 2024

Version

5.26.2

Describe the bug

Getting this error when trying to use translations inside the redirect function:

if (!user) throw redirect(302, `/auth?error=${get(t).auth.need_to_sign_up_first()}`);

When my translation file was small there was no problem.
After it got bigger I got this error.
It is only in the dev server on my local machine.

Guess it's related to transpilation. In production the files are minified so there is no error there.

Any suggestions for how I can solve this?

Reproduction

Get a big translation dictionary and use it in redirect.

Logs

/auth/login/google
TypeError: Cannot convert argument to a ByteString because the character at index 12 has a value of 1506 which is greater than 255.
    at webidl.converters.ByteString (node:internal/deps/undici/undici:1685:17)
    at Object.record<ByteString, ByteString> (node:internal/deps/undici/undici:1594:32)
    at webidl.converters.HeadersInit (node:internal/deps/undici/undici:2126:67)
    at Object.ResponseInit (node:internal/deps/undici/undici:1650:21)
    at new _Response (node:internal/deps/undici/undici:4664:34)
    at Module.render_endpoint (/Users/moshe_ya/dev/voice-ops/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js:67:11)
    at async resolve (/Users/moshe_ya/dev/voice-ops/node_modules/@sveltejs/kit/src/runtime/server/respond.js:420:17)
    at async google_calendar (/Users/moshe_ya/dev/voice-ops/src/hooks/calendar.ts:8:11)
    at async i18n (/Users/moshe_ya/dev/voice-ops/src/hooks/i18n.ts:14:10)
    at async check_caller (/Users/moshe_ya/dev/voice-ops/src/hooks/check_caller.ts:6:11)

Config

No response

Additional information

No response

@moshe5745 moshe5745 added the bug Something isn't working label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant