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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

unraw default export resolution error in React Native 0.73.2 #1836

Closed
estrattonbailey opened this issue Jan 16, 2024 · 1 comment 路 Fixed by #1837
Closed

unraw default export resolution error in React Native 0.73.2 #1836

estrattonbailey opened this issue Jan 16, 2024 · 1 comment 路 Fixed by #1837

Comments

@estrattonbailey
Copy link

Hey all 馃憢 love the library, thanks for all the work here.

We're running into a an default export issue in our 0.73.2 app where the default import of unraw isn't resolved and crashes our app in production. See GitHub issue here.

Looks like unraw provides a named export as well, and using the patch from patch-package below solves our problem.

diff --git a/node_modules/@lingui/core/dist/index.mjs b/node_modules/@lingui/core/dist/index.mjs
index 9759736..881f67b 100644
--- a/node_modules/@lingui/core/dist/index.mjs
+++ b/node_modules/@lingui/core/dist/index.mjs
@@ -1,4 +1,4 @@
-import unraw from 'unraw';
+import { unraw } from 'unraw';
 import { compileMessage } from '@lingui/message-utils/compileMessage';
 
 const isString = (s) => typeof s === "string";

Would you be open to a PR to use the named export instead of the default?

@thekip
Copy link
Collaborator

thekip commented Jan 17, 2024

aghh, hate default import/export, so much pain, especially when ecosystem started switching to native ES modules.

Thanks for reporting, i will update

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

Successfully merging a pull request may close this issue.

3 participants