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

Bug: Error when selecting a date property in card view #918

Closed
sbishel opened this issue Aug 10, 2021 · 1 comment · Fixed by #933
Closed

Bug: Error when selecting a date property in card view #918

sbishel opened this issue Aug 10, 2021 · 1 comment · Fixed by #933
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@sbishel
Copy link
Member

sbishel commented Aug 10, 2021

Summary:
When selecting a date property in card view you receive a page that simply states

"Something went wrong."

Javascript error "Cannot read property 'localeData' of undefined"

Steps to reproduce the behavior:

  1. Go to any card.
  2. Create a new Date Property
  3. Click on "Empty" to load the day picker.
  4. See error

Expected behavior:
Day Picker is loaded successfully.

Screenshots:
Screen Shot 2021-08-10 at 12 28 39 PM

Platform:

  • Browser and version: Chrome 92
  • OS and version: macOS 11.4

Additional context:

@sbishel sbishel added the Bug Something isn't working label Aug 10, 2021
@chenilim chenilim added this to the v0.9 milestone Aug 10, 2021
@sbishel
Copy link
Member Author

sbishel commented Aug 10, 2021

This has something with the way are doing new builds for plugins, checked the prior commit and it works. It works fine with Personal Server.

When building mattermost-plugin, make dist. A warning is displayed -

WARNING in ../../webapp/node_modules/react-day-picker/src/moment.js 1:0-73
export 'MomentLocalUtils' (reexported as 'default') was not found in './addons/MomentLocaleUtils' (possible exports: default, formatDate, formatDay, formatMonthTitle, formatWeekdayLong, formatWeekdayShort, getFirstDayOfWeek, getMonths, parseDate)
 @ ../../webapp/node_modules/react-day-picker/build/addons/MomentLocaleUtils.js
 @ ../../webapp/node_modules/react-day-picker/moment/index.js 1:0-61
 @ ../../webapp/src/widgets/editableDayPicker.tsx 30:33-67
 @ ../../webapp/src/components/propertyValueElement.tsx 35:44-83
 @ ../../webapp/src/components/kanban/kanbanCard.tsx 19:47-81
 @ ../../webapp/src/components/kanban/kanban.tsx 35:37-60
 @ ../../webapp/src/components/centerPanel.tsx 24:33-59
 @ ../../webapp/src/components/workspace.tsx 11:38-62
 @ ../../webapp/src/pages/boardPage.tsx 14:36-70
 @ ../../webapp/src/app.tsx 35:36-64
 @ ./src/index.tsx 32:30-64

100% of time, if the warning is displayed during build, the error will occur.

Commenting out this line, gets around error, so definitely related to 'MomentLocaleUtils'
https://github.com/mattermost/focalboard/blob/main/webapp/src/components/properties/dateRange/dateRange.tsx#L234

Can also be replicated using existing EditableDatePicker.

@jespino jespino self-assigned this Aug 11, 2021
sbishel added a commit to jespino/focalboard that referenced this issue Aug 11, 2021
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

Successfully merging a pull request may close this issue.

3 participants