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/assets ships Flow instead of JS #36343

Open
nandorojo opened this issue Mar 1, 2023 · 5 comments
Open

@react-native/assets ships Flow instead of JS #36343

nandorojo opened this issue Mar 1, 2023 · 5 comments
Labels
Never gets stale Prevent those issues and PRs from getting stale

Comments

@nandorojo
Copy link

Description

The assets package is shipping flow JS directly, making it break when importing on Next.js. It should build prior to publishing and remove types.

See: https://github.com/facebook/react-native/blob/main/packages/assets/registry.js

Let me know if I should PR, though I know TypeScript and not flow. Could also migrate it.

React Native Version

0.71

Output of npx react-native info

N/A

Steps to reproduce

See https://github.com/facebook/react-native/blob/main/packages/assets/registry.js

Snack, code example, screenshot, or link to a repository

If you need a repro, you can try importing @react-native/assets in Next.js. It's pretty self-explanatory though.

Thanks!

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

⚠️ Add or Reformat Version Info
ℹ️ We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2

@cortinico
Copy link
Contributor

Related to this other issue: #35263 (comment)

(cc @necolas @lunaleaps)

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 29, 2023
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@sergioisidoro
Copy link

sergioisidoro commented Nov 1, 2024

Any or work arround for this. For using webpack this is documented and mentioned -- https://necolas.github.io/react-native-web/docs/multi-platform/#compiling-and-bundling -- but we're using Vite, and this issue started to pop up on react native 0.74

Update: For using Vite, I've found a vite plugin that includes an EsBuild plugin using flow-remove-types package to transform the source and remove flow types - https://github.com/Bram-dc/vite-plugin-react-native-web. I was able to bypass this issue and get the application to build, although with some ongoing issues with testing setup.

@necolas necolas reopened this Nov 1, 2024
@react-native-bot react-native-bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 2, 2024
@cortinico cortinico added the Never gets stale Prevent those issues and PRs from getting stale label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Never gets stale Prevent those issues and PRs from getting stale
Projects
None yet
Development

No branches or pull requests

5 participants