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

React native development cause ttext ${interpolated} example to return function instead of string #1042

Closed
kopax-polyconseil opened this issue Apr 13, 2021 · 7 comments

Comments

@kopax-polyconseil
Copy link

kopax-polyconseil commented Apr 13, 2021

Following #1022, I have created two separate bug identified in v3.

Describe the bug

In a React Native application, we use metro and target iOS, Android and web.

I am not sure this is specific to react native development environement but that would sound odd.

Within our development environment (this bug is not happening within our production build), we often have issue with template literral not interpolating string and returning function, this cause warning everywhere in our application and missing text.

image

On Android Galaxy S9

image

On iPhone 6, it cause application crash

image

To Reproduce

This is how we integrated the issue: pass-culture/pass-culture-app-native#842

It's hard to tell since @semoal tried to bootstrap a clean react-native application to reproduce, while we migrated from v2 to v3 on an existing application

Expected behavior

We expect lingui to always translate the text as a string in the development and production build.

It's not ideal, but it can be fixed while developing by calling .toString() on template variables

Additional context

Add any other context about the problem here.

@kopax-polyconseil
Copy link
Author

kopax-polyconseil commented Apr 19, 2021

Hi @semoal, I hope you add a good weekend. Did you have a thought on that one?

Our v3 migration added some complexity to our devs, as in this commit pass-culture/pass-culture-app-native@dba46af .

We finally decided to switch to this syntax : pass-culture/pass-culture-app-native#925 so we can keep using v3, but the new syntax is really verbose.

I would love to know if you have a plan to work on it soon. I myself, have no clue where and how to fix this but I am of course available to assist.

@semoal
Copy link
Contributor

semoal commented Apr 21, 2021

Actually I'm really busy with my current job and other noise I have around me, once I find time I'll work on this issue and I'll create a pr on your repository doing it simple another time.

Sorry for the inconveniences but OSS doesn't give me enough to focus on every issue all my entire time

@semoal
Copy link
Contributor

semoal commented May 11, 2021

I think Dimitri that I have found the issue of this, #1059
On older versions than 3.6.0, for example 3.4.0 everything should work fine but in 3.6.0 i've released an ESM new strategy of building and I've forgot to add the ESM development runtime that's probably the reason of the warnings in development and not in production.

I'll ping you the next tuesday and give it a try with the other syntax to see if the issue has gone =) Hope this is a further step for making it easier to you guys

@kopax-polyconseil
Copy link
Author

Hi @semoal , I hope you are good. Sorry I forgot to reply but I read you. I am glad that you are fixing this issue because it's kind of annoying having to explain those bugs to others. We are currently deploying the app to production, I presume we can take care of testing the next version starting next week if you have solved it by then.

Otherwise, let me know how we can help,

@semoal
Copy link
Contributor

semoal commented May 18, 2021

Released 3.9.0 give it a try when you can, but i'm pretty sure that will fixed :)

@semoal semoal closed this as completed May 18, 2021
@kopax-polyconseil
Copy link
Author

Hi @semoal , I was going to write to you a message. Thanks for meanwhile taking care of fixing the issue.

We were supposed to go prod today, unfortunately this is what we got in production (with the old version):

image

We're done for today, but we'll definitely try to upgrade to 3.9.0 and see if it fixes, otherwise we may have a long day reverting :), I'll keep you tuned.

@kopax-polyconseil
Copy link
Author

Hi Semoal, I just tested 3.9.0, we still have the sames string not being displayed with the function error in development. Seems not fixed.

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

No branches or pull requests

2 participants