question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.17 -> .18 initialization

See original GitHub issue

Do you want to request a feature or report a bug?

bug

What’s the current behavior?

.17 initializes correctly with:

import * as moment from 'moment';
import BigCalendar from 'react-big-calendar';

and then

BigCalendar.momentLocalizer(moment);

But when I use .18, the BigCalendar variable isn’t initialized, so the momentLocalizer method doesn’t exist and it throws an error that BigCalendar is undefined. Did something change from .17 to .18 that changed the initialization?

What’s the expected behavior?

BigCalendar object should be initialized and ready to render.

Sorry for the relative paucity of details. Given that this issue is with the barest beginning of use, I feel like it’s pretty quick to reproduce.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20

github_iconTop GitHub Comments

3reactions
josdejongcommented, Jun 25, 2018

Same issue here using a react+typescript application (create-react-app with react-scripts-ts).

In our case BigCalendar was initialized correctly when in develop mode, but when creating a bundle the variable was undefined.

As a workaround I use require instead of import:

const BigCalendar = require('react-big-calendar')
1reaction
ggsjyooncommented, Jun 28, 2018

It’s okay. I’m not using no-var-requires.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Has the C++17 extension to aggregate initialization made ...
It is true that C++17 has now added a new aggregate construction method, but it leading to a problem here relies on your...
Read more >
Initialization in C++ is Seriously Bonkers - No TV and No Beer
The trend is to be more permissive of what is considered an aggregate. For example, public base classes are allowed in aggregates as...
Read more >
Initialization in modern C++ - Timur Doumler - YouTube
Initialization in modern C++Timur DoumlerMeeting C++ 2018Slides: https://meetingcpp.com/mcpp/slides.
Read more >
Constant initialization - Andrzej's C++ blog - WordPress.com
In short, this is a new way global, static and thread-local objects (not necessarily constant) can be initialized without running into problems ...
Read more >
abseil / Tip of the Week #146: Default vs Value Initialization
TotW #18: String Formatting with Substitute · TotW #24: Copies, Abbrv. ... TotW #175: Changes to Literal Constants in C++14 and C++17.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found