"Unknown variable dynamic import: ./lang/<unset>.json" = Error while saving user settings #100

Closed
opened 2025-11-01 20:46:54 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @timdonovanuk on GitHub (Nov 1, 2022).

Description

Please jump to my last comment as I think I've found a solution to the saving User settings, which appears to be a different bug. I think the ./lang/ error is something else...

  1. My Vikunja is served through Nginx Proxy Manager on another server
  2. I use an external domain and Cloudflare for TLS certificates / HTTPS
  3. I have set proxypass for api|dav|.well-known
  4. On logging in, I get a persistent error below in Chrome console
  5. Everything works fine (e.g. adding tasks, creating labels) but I cannot change any user settings, as I get a "Error while saving user settings"

Addtional point this issue happens even when accessing my vikunja internally, i.e. via http://192.168.1.81/

Persistent on is:

index.e6832412.js:48 Uncaught (in promise) Error: Unknown variable dynamic import: ./lang/<unset>.json
    at index.e6832412.js:48:7459
    at new Promise (<anonymous>)
    at __variableDynamicImportRuntimeHelper (index.e6832412.js:48:7365)
    at loadLanguageAsync (index.e6832412.js:48:45100)
    at setLanguage (index.e6832412.js:48:47086)
    at setup (index.e6832412.js:114:233599)
    at callWithErrorHandling (index.e6832412.js:4:789)
    at setupStatefulComponent (index.e6832412.js:4:65514)
    at setupComponent (index.e6832412.js:4:65167)
    at ge (index.e6832412.js:4:49106)

Trying to save user settings the error is:

POST https://vikunja.mydomain.co.uk/api/v1/user/settings/general 500

Thanks!

Vikunja Frontend Version

Vikunja frontend version 0.20.0

Vikunja API Version

0.20.0

Browser and version

Chrome

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @timdonovanuk on GitHub (Nov 1, 2022). ### Description **Please jump to my last comment as I think I've found a solution to the saving User settings, which appears to be a different bug. I think the ./lang/ error is something else...** 1. My Vikunja is served through Nginx Proxy Manager on another server 2. I use an external domain and Cloudflare for TLS certificates / HTTPS 3. I have set proxypass for api|dav|\.well-known 4. On logging in, I get a persistent error below in Chrome console 5. Everything works fine (e.g. adding tasks, creating labels) but I cannot change any user settings, as I get a "Error while saving user settings" **Addtional point this issue happens even when accessing my vikunja internally, i.e. via http://192.168.1.81/** Persistent on is: ``` index.e6832412.js:48 Uncaught (in promise) Error: Unknown variable dynamic import: ./lang/<unset>.json at index.e6832412.js:48:7459 at new Promise (<anonymous>) at __variableDynamicImportRuntimeHelper (index.e6832412.js:48:7365) at loadLanguageAsync (index.e6832412.js:48:45100) at setLanguage (index.e6832412.js:48:47086) at setup (index.e6832412.js:114:233599) at callWithErrorHandling (index.e6832412.js:4:789) at setupStatefulComponent (index.e6832412.js:4:65514) at setupComponent (index.e6832412.js:4:65167) at ge (index.e6832412.js:4:49106) ``` Trying to save user settings the error is: `POST https://vikunja.mydomain.co.uk/api/v1/user/settings/general 500` Thanks! ### Vikunja Frontend Version Vikunja frontend version 0.20.0 ### Vikunja API Version 0.20.0 ### Browser and version Chrome ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@timdonovanuk commented on GitHub (Nov 1, 2022):

Could it be caused by this?

image

Which causes a malformed POST JSON payload:

image

@timdonovanuk commented on GitHub (Nov 1, 2022): Could it be caused by this? ![image](https://user-images.githubusercontent.com/8156439/199227985-0d22acd5-1056-48d6-86bb-7968dd51b775.png) Which causes a malformed POST JSON payload: ![image](https://user-images.githubusercontent.com/8156439/199228080-3e87fb33-4d47-4d9c-8c98-797b17920fc2.png)
Author
Owner

@timdonovanuk commented on GitHub (Nov 1, 2022):

If I fill out these fields properly I can at least press Save without issue:

image

@timdonovanuk commented on GitHub (Nov 1, 2022): If I fill out these fields properly I can at least press Save without issue: ![image](https://user-images.githubusercontent.com/8156439/199228484-5444983d-0357-4892-974b-67886b59bf63.png)
Author
Owner

@kolaente commented on GitHub (Nov 1, 2022):

This looks like you set the value of the defaultsettings.timezone server config option to the literal string <time zone set at service.timezone>. Can you check that?

@kolaente commented on GitHub (Nov 1, 2022): This looks like you set the value of the `defaultsettings.timezone` server config option to the literal string `<time zone set at service.timezone>`. Can you check that?
Author
Owner

@timdonovanuk commented on GitHub (Nov 1, 2022):

Hey @kolaente thanks - I didn't set it to anything, the default value is set to this it seems c83cb8480d/config.yml.sample (L351)

The docs say this defaults to GMT (https://vikunja.io/docs/config-options/#timezone)

I followed the documentation and it didn't mention needing to set this - "If you don’t provide a value in your config file, their default will be used.". Perhaps a working default could be provided in the config.yml?

@timdonovanuk commented on GitHub (Nov 1, 2022): Hey @kolaente thanks - I didn't set it to anything, the default value is set to this it seems https://github.com/go-vikunja/api/blob/c83cb8480d22ce5752efd97be0db2daa9527a967/config.yml.sample#L351 The docs say this defaults to GMT (https://vikunja.io/docs/config-options/#timezone) I followed the documentation and it didn't mention needing to set this - "If you don’t provide a value in your config file, their default will be used.". Perhaps a working default could be provided in the config.yml?
Author
Owner

@timdonovanuk commented on GitHub (Nov 1, 2022):

Can confirm this also solves the "Unknown variable dynamic import: ./lang/.json" issue though! Magic, thanks 🥇

@timdonovanuk commented on GitHub (Nov 1, 2022): Can confirm this also solves the "Unknown variable dynamic import: ./lang/<unset>.json" issue though! Magic, thanks 🥇
Author
Owner

@timdonovanuk commented on GitHub (Nov 1, 2022):

I'd also suggest making the default overdue_tasks_reminders_time: 09:00 and not "9:00" in the config.yml (as 9:00 is not a valid value!)

@timdonovanuk commented on GitHub (Nov 1, 2022): I'd also suggest making the default `overdue_tasks_reminders_time: 09:00` and not "9:00" in the config.yml (as 9:00 is not a valid value!)
Author
Owner

@kolaente commented on GitHub (Nov 1, 2022):

The default value is set here:

https://github.com/go-vikunja/api/blob/main/pkg/config/config.go#L457-L459

If you set a value in the config file it will use whatever you put in there. It will use the value from service.timezone if you don't specify a value (that's how default values are handled in Vikunja). We use the sample file to generate the config docs with their default values, hence the speaking value of the default value. There is probably a better way to do that though.

I'd also suggest making the default overdue_tasks_reminders_time: 09:00 and not "9:00" in the config.yml (as 9:00 is not a valid value!)

Do you want to send a PR?

@kolaente commented on GitHub (Nov 1, 2022): The default value is set here: https://github.com/go-vikunja/api/blob/main/pkg/config/config.go#L457-L459 If you set a value in the config file it will use whatever you put in there. It will use the value from `service.timezone` if you don't specify a value (that's how default values are handled in Vikunja). We use the sample file to generate [the config docs](https://vikunja.io/docs/config-options) with their default values, hence the speaking value of the default value. There is probably a better way to do that though. > I'd also suggest making the default overdue_tasks_reminders_time: 09:00 and not "9:00" in the config.yml (as 9:00 is not a valid value!) Do you want to send a PR?
Author
Owner

@timdonovanuk commented on GitHub (Nov 1, 2022):

The default value is set here:

https://github.com/go-vikunja/api/blob/main/pkg/config/config.go#L457-L459

Thanks @kolaente, but not sure I'm following - do you think I edited my config.yaml to set defaultsettings.timezone to the literal value <time zone set at service.timezone>? 😆

  • I followed the install documentation
  • "If you set a value in the config file" I did not touch config.yml
  • I ended up with an invalid value in my installation...

It will use the value from service.timezone if you don't specify a value (that's how default values are handled in Vikunja)

So there must be a bug there, because I didn't specify a value...and Vikunja ended up using the default value of <time zone set at service.timezone>

Does that make sense?

Do you want to send a PR?

Sure :)

@timdonovanuk commented on GitHub (Nov 1, 2022): > The default value is set here: > > https://github.com/go-vikunja/api/blob/main/pkg/config/config.go#L457-L459 > Thanks @kolaente, but not sure I'm following - do you think I edited my config.yaml to set `defaultsettings.timezone` to the literal value `<time zone set at service.timezone>`? 😆 - I followed the install documentation - "If you set a value in the config file" I did not touch config.yml - I ended up with an invalid value in my installation... > It will use the value from `service.timezone` if you don't specify a value (that's how default values are handled in Vikunja) So there must be a bug there, because I didn't specify a value...and Vikunja ended up using the default value of `<time zone set at service.timezone>` Does that make sense? > Do you want to send a PR? Sure :)
Author
Owner

@kolaente commented on GitHub (Nov 2, 2022):

do you think I edited my config.yaml to set defaultsettings.timezone to the literal value

Probably not - I assume you copied the default config file?

So there must be a bug there, because I didn't specify a value

I wouldn't say that's a bug. The value seems to be specified in the config file, even if you didn't put it there. This should be fixed when generating the default config file.

@kolaente commented on GitHub (Nov 2, 2022): > do you think I edited my config.yaml to set defaultsettings.timezone to the literal value <time zone set at service.timezone>? Probably not - I assume you copied the default config file? > So there must be a bug there, because I didn't specify a value I wouldn't say that's a bug. The value seems to be specified in the config file, even if you didn't put it there. This should be fixed when generating the default config file.
Author
Owner

@kolaente commented on GitHub (Nov 2, 2022):

I'll close this as it seems to be a configuration issue and you already submitted a PR to fix one of the default values. The problem of general invalid default values in the default config file should be solved in another issue.

@kolaente commented on GitHub (Nov 2, 2022): I'll close this as it seems to be a configuration issue and you already submitted a PR to fix one of the default values. The problem of general invalid default values in the default config file should be solved in another issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#100