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

Allow compilation without dynamic requires #536

Closed
stantoncbradley opened this issue Oct 2, 2017 · 3 comments
Closed

Allow compilation without dynamic requires #536

stantoncbradley opened this issue Oct 2, 2017 · 3 comments

Comments

@stantoncbradley
Copy link

In the moment dependency, The current master build of metro-packager/react-native really doesn’t like dynamic require statements. Importing the current version of moment produces the error

TransformError: /.../moment/moment.js: require() must have a single string literal argument

moment/moment#4187 fixes the issue in moment.js.

I'm opening this issue because once that PR is merged, the moment dependency in moment-timezone needs to be updated to capture these changes.

thanks for the awesome lib!

@lnikkila
Copy link

lnikkila commented Oct 5, 2017

I’m getting moment.version is undefined when trying to use moment from the linked PR with the current moment-timezone. When importing moment manually and checking what it contains, seems there’s a default export...

Seems it’s related to this:
moment/moment#4187 (comment)

Fails on this line:
https://github.com/moment/moment-timezone/blob/2b8da8f/moment-timezone.js#L34

@vtoupet
Copy link

vtoupet commented Nov 26, 2017

I am also interested in seeing this problem fixed. What could be done to speed up things?

@gilmoreorless
Copy link
Member

Moment Timezone doesn't contain any dynamic requires. Any lingering problems with core Moment not being updated could be due to package manager oddities. See #982 (comment) for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants