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: web exports on prepare file #2430

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

migueldaipre
Copy link

@migueldaipre migueldaipre commented Aug 28, 2024

Summary

Fixes #2401

Fixes error in prepare.ts file that imports hasTouchableProperty from a '.' file.

It's probably related to the way ESM works, I'm not sure. I base it on PR

(0 , _.hasTouchableProperty) is not a function 
TypeError: (0 , _.hasTouchableProperty) is not a function 
at prepare
image

Test Plan

Should work without error on web

web-working.mov

Compatibility

OS Implemented
Web

Checklist

  • I have tested this on a web project

@migueldaipre migueldaipre changed the title Fix web exports on prepare file fix: web exports on prepare file Aug 28, 2024
@a-eid
Copy link

a-eid commented Oct 18, 2024

this worked for me. patched the package for now. thanks @migueldaipre

@brycnguyen
Copy link

Can we merge this?

@jakex7
Copy link
Member

jakex7 commented Jan 8, 2025

Hey @migueldaipre, thanks for sharing that! It looks good, however before we proceed with the merge, I’d like to gain a deeper understanding of the issue to prevent similar problems in the future. Could you share a repository where this issue can be reproduced? I’m not encountering it on our web-example.

@brycnguyen
Copy link

I'm currently using webpack for my expo project and ran into this issue

@idrisssakhi
Copy link

this fix is highly important for apps supporting web and having last version of react native with new-arch activated.
would you merge it please we are blocked. and i can't patch in my mmonorepo. the patch is applied but generated bob files are not re-generated after patch causing issue

@brycnguyen
Copy link

this fix is highly important for apps supporting web and having last version of react native with new-arch activated. would you merge it please we are blocked. and i can't patch in my mmonorepo. the patch is applied but generated bob files are not re-generated after patch causing issue

Until it is fixed, what I did was I cloned this repo, made the changes locally, ran the build command to generate the /web folder and replaced that in my yarn patch directory of this library.

@idrisssakhi
Copy link

@migueldaipre thank you for this great work. Is it possible to fix the conflicts ?
@jakex7 it's purely a typescript issue, adding a tsc check on next versions will help avoid such issue

@migueldaipre
Copy link
Author

Hey @migueldaipre, thanks for sharing that! It looks good, however before we proceed with the merge, I’d like to gain a deeper understanding of the issue to prevent similar problems in the future. Could you share a repository where this issue can be reproduced? I’m not encountering it on our web-example.

Hey there, I haven't had time to create a repro and the current project is private and large. But that's just down to how the code is imported, when I use “.” the error happens, when I change to “./index” the error doesn't happen.

@G2Jose
Copy link

G2Jose commented Feb 1, 2025

Anything we can do to get this in soon? I'm running into this issue as well.

@bastdus
Copy link

bastdus commented Feb 6, 2025

Same here. It's been broken since version 15.5 on the web.

Screenshot 2025-02-06 at 19 19 06

Downgrade to 15.4 until it's fixed.

@G2Jose
Copy link

G2Jose commented Feb 6, 2025

Here's a patch you can use with patch-package based on this Pull Request until it's merged

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.

7 participants