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

DatePicker: Missing locale crashes application #2836

Closed
goodefroi opened this issue Feb 18, 2021 · 4 comments · Fixed by #2844
Closed

DatePicker: Missing locale crashes application #2836

goodefroi opened this issue Feb 18, 2021 · 4 comments · Fixed by #2844
Labels
bug This issue is a bug in the code High Prio TOPIC Core

Comments

@goodefroi
Copy link

Describe the bug
Expanding a DatePicker component causes the app to crash (in development) when the browser is set to a locale that is not provided.

Isolated Example
Isolated example on codesandbox.io.

To Reproduce
Steps to reproduce the behavior:

  1. Add a DatePicker component.
  2. Click on it to open the date selection calendar.
  3. Enjoy fireworks

Expected behavior
Yeah, not this. Fall back to en_US or some other generic locale.

Screenshots
image

UI5 Web Components for React Information
@ui5/webcomponents version: 1.0.0-rc.12
@ui5/webcomponents-react version: 0.14.0
Operating System: macOS 11.2.1
Browser: Chrome 88

@MarcusNotheis
Copy link
Collaborator

Hey @goodefroi,
thanks for reporting. As a workaround you can import the Assets in your index file:

import '@ui5/webcomponents/dist/Assets';
import '@ui5/webcomponents-fiori/dist/Assets';
import '@ui5/webcomponents-react/dist/Assets';

These assets are now dynamic and loaded when required, so it won't bloat your bundlesize like before when importing them.
I'll also reach out to the Web Components Team in order to give you a better answer here.

@vladitasev Any opinions?

@MarcusNotheis
Copy link
Collaborator

Happening with plain UI5 Web Components as well, so I'll forward this to the UI5 Web Components repo:
https://codesandbox.io/s/crazy-forest-zlvxr

@MarcusNotheis MarcusNotheis transferred this issue from SAP/ui5-webcomponents-react Feb 18, 2021
@ilhan007 ilhan007 added High Prio bug This issue is a bug in the code labels Feb 19, 2021
@goodefroi
Copy link
Author

Hey @goodefroi,
thanks for reporting. As a workaround you can import the Assets in your index file:

import '@ui5/webcomponents/dist/Assets';
import '@ui5/webcomponents-fiori/dist/Assets';
import '@ui5/webcomponents-react/dist/Assets';

These assets are now dynamic and loaded when required, so it won't bloat your bundlesize like before when importing them.
I'll also reach out to the Web Components Team in order to give you a better answer here.

Dear @MarcusNotheis, thank you very much for your help. I really appreciate the quick reaction times of you and your team whenever I submitted an issue in the past.

@pskelin
Copy link
Contributor

pskelin commented Feb 19, 2021

As a workaround you can import the Assets in your index file:

import '@ui5/webcomponents/dist/Assets';
import '@ui5/webcomponents-fiori/dist/Assets';
import '@ui5/webcomponents-react/dist/Assets';

@MarcusNotheis That's the right approach, yes. It is also not a workaround as it is necessary for productive usage anyway.

The development work case should not crash however, and a change with a warning and a fallback option is in preparation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug in the code High Prio TOPIC Core
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

4 participants