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

fix: just use require to import services #1647

Merged
merged 1 commit into from
May 15, 2023
Merged

Conversation

ZhengYuTay
Copy link
Contributor

  • update services to be async and can be awaited

Description

from #1631, there is error importing TranslationIO service with import. It result in Cannot find module. The problem is that it need the js extension.

One solution is to add js extension import('xxx' + .js) , but the result would still need to be

import('xxx'.js).then(module => module.default.default(xxx))

Not sure why the double default there, but using require would solve at least the double default.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Fixes # (issue)
#1631

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

- update services to be async and can be awaited
@vercel
Copy link

vercel bot commented May 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2023 7:24am

@github-actions
Copy link

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 1.43 KB (0%)
./packages/detect-locale/dist/index.mjs 721 B (0%)
./packages/react/dist/index.mjs 1.6 KB (0%)
./packages/remote-loader/dist/index.mjs 7.24 KB (0%)

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.08 ⚠️

Comparison is base (eb0ceac) 75.33% compared to head (657ea87) 75.26%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1647      +/-   ##
==========================================
- Coverage   75.33%   75.26%   -0.08%     
==========================================
  Files          77       77              
  Lines        1995     1997       +2     
  Branches      517      517              
==========================================
  Hits         1503     1503              
- Misses        377      379       +2     
  Partials      115      115              
Impacted Files Coverage Δ
packages/cli/src/lingui-extract.ts 18.39% <0.00%> (-0.22%) ⬇️
packages/cli/src/services/translationIO.ts 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@timofei-iatsenko timofei-iatsenko self-requested a review May 10, 2023 08:21
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that should help.

@andrii-bodnar andrii-bodnar merged commit 388c77b into lingui:main May 15, 2023
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

Successfully merging this pull request may close these issues.

Translation.io service problem after upgrade @lingui/cli from v4.0.0-next.5 to v4.0.0
3 participants