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

Gallaria: localeOption is not defined. Bug introduced in 8.6.0 #3370

Closed
kbeeveer46 opened this issue Sep 27, 2022 · 1 comment · Fixed by #3372
Closed

Gallaria: localeOption is not defined. Bug introduced in 8.6.0 #3370

kbeeveer46 opened this issue Sep 27, 2022 · 1 comment · Fixed by #3372
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@kbeeveer46
Copy link

kbeeveer46 commented Sep 27, 2022

Describe the bug

EDIT: I just downgraded to 8.5.0 and the error no longer happens. This appears to be a bug introduced in 8.6.0+ and probably from the ticket I linked to at the bottom of this ticket.

EDIT 2: I narrowed it down to the "fullscreen" property. Here is a working code sandbox. When you remove the fullscreen property the error goes away. I'm not doing anything with locales in this demo so it appears that just adding the property alone triggers the error. https://codesandbox.io/s/focused-field-n206bj?file=/src/demo/GalleriaThumbnailDemo.js

I've added several locales to my app using addLocale. Setting the locale property on date pickers and other inputs seems to work just fine. But when I load a page that has a Gallaria component with images I get the following error. It does not throw an error if there are no images.

localeOption is not defined

This is my Gallaria component

<Galleria
      ref={photoGalleryRef}
      value={photoGalleryImages}
      numVisible={100}
      className="propertyPhotoGallery"
      circular
      fullScreen
      showItemNavigators
      item={photoGalleryFullImageTemplate}
      thumbnail={photoGalleryThumbnailTemplate}
      caption={(file: any) => { return file?.documentName; }}
  />

Here is the error log and a screen shot of the exact line

ReferenceError: localeOption is not defined
    at createElement (galleria.esm.js:828:1)
    at createGalleria (galleria.esm.js:878:1)
    at galleria.esm.js:911:21
    at Yr (sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:63936)
    at To (sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:71870)
    at ys (sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:112067)
    at pc (sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:102601)
    at uc (sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:102526)
    at ac (sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:99556)
    at sp-webpart-workbench-assembly_en-us_7114918d89bda4ca8c8d54c2cd0782b3.js:69:51350

image

I do not know how to set up code sandbox since this component requires image files (I'll try to work on one in the meantime and I'll put it in this ticket).

Is the error related to a recent change from this ticket? Both aria and localeOption are involved in this ticket. #3280

Is there a setting I'm forgetting to apply? There's no locale property one the Gallaria component. Here is a sample of one of my locales

export const frCA = {
    firstDayOfWeek: 1,
    dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
    dayNamesShort: ['dim', 'lun', 'mar', 'mer', 'jue', 'ven', 'sam'],
    dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
    monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
    monthNamesShort: ['janv', 'févr', 'mars', 'avril', 'mai', 'juin', 'juil', 'août', 'sept', 'oct', 'nov', 'déc'],
    today: "Aujourd'hui",
    clear: 'Dégager',
    close: 'Fermer',
};

addLocale('fr-CA', frCA);

Reproducer

No response

PrimeReact version

8.6.1

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome

Steps to reproduce the behavior

View a page that has a Gallaria component on it,

Expected behavior

No response

@kbeeveer46 kbeeveer46 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 27, 2022
@kbeeveer46 kbeeveer46 changed the title Gallaria: localeOption is not defined Gallaria: localeOption is not defined. Bug introduced in 8.6.0 Sep 27, 2022
melloware added a commit to melloware/primereact that referenced this issue Sep 27, 2022
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 27, 2022
@melloware melloware self-assigned this Sep 27, 2022
@melloware melloware added this to the 8.6.2 milestone Sep 27, 2022
@melloware
Copy link
Member

Thank for reporting. Fixed it for 8.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants