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

Error in Mac build: Timezone is not one of enum values: null #842

Closed
rly opened this issue Jun 8, 2024 · 4 comments
Closed

Error in Mac build: Timezone is not one of enum values: null #842

rly opened this issue Jun 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@rly
Copy link
Collaborator

rly commented Jun 8, 2024

Describe the issue

image

I was following the single session tutorial from the beginning. The box was auto-filled. I tried to click Next to proceed and got this error and cannot proceed.

Console:

index-178c0fa4.js:30585 Uncaught (in promise) Error: Timezone is not one of enum values: null.
    at JSONSchemaForm.throw (index-178c0fa4.js:30585:11)
    at JSONSchemaForm.validate (index-178c0fa4.js:30638:19)
    at async GuidedPreform.beforeSave (index-178c0fa4.js:158135:5)
    at async GuidedPreform.save (index-178c0fa4.js:132193:7)
    at async GuidedFooter.onNext [as __onNext] (index-178c0fa4.js:158140:7)

Earlier in the console, I see:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'split')
    at index-178c0fa4.js:126114:33
    at Array.reduce (<anonymous>)
    at index-178c0fa4.js:126113:51

That code points to:

timezoneSchema.enumLabels = filteredTimezones.reduce((acc, tz) => {
      const [_2, ...other] = tz.split("/");
      acc[tz] = other.map((part) => header(part)).join(" — ");
      return acc;
    }, {});

It seems like the timezones are not being loaded by the time the enumLabels are being set.

If I clear the box, I see an empty dropdown.

On a local build from the main branch (npm start), I do not encounter this error.

On a local build from the .app file (after npm run deploy:mac and aborting while code-signing), strangely, I also do not encounter this error...

I will keep trying to reproduce this locally.

Steps to Reproduce

Download latest mac arm64 test 1.0 release and run through tuturial

Operating System

Mac OS with Mac M1

GUIDE Version

1.0 test

Code of Conduct

Yes

Did you confirm this issue was not already reported?

Yes

@rly rly added the bug Something isn't working label Jun 8, 2024
@rly
Copy link
Collaborator Author

rly commented Jun 8, 2024

The API endpoint http://localhost:4242/system/all_timezones returns [] and http://localhost:4242/system/local_timezone returns null.

We may need to add this to nwb-guide.spec:

tmp_ret = collect_all('tzdata')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]

Will test after #841 is good.

@CodyCBakerPhD
Copy link
Collaborator

I mean, isn't zoneinfo supposed to be a built-in after 3.9?

@rly
Copy link
Collaborator Author

rly commented Jun 8, 2024

It is, but there might be an issue with finding and packaging resource files from that module. https://stackoverflow.com/questions/67711882/exchangelib-and-pyinstaller-zoneinfo-tzdata-utc-issue

It's possible that because the import is within a function, pyinstaller doesn't know to add those files. I'm not sure.

@rly
Copy link
Collaborator Author

rly commented Jun 8, 2024

Fixed by #843

@rly rly closed this as completed Jun 8, 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

2 participants