-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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
Jest react native SyntaxError: Unexpected identifier when using pnpm package installer #36765
Comments
Just a heads up that we don't fully support pnpm. This is due to Metro limitations with symlink support. We're looking into it so hopefully we will be able to relax this requirement soon |
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. |
@1mehdifaraji
|
This looks like a very similar issue to #33426 - both swc/jest and pnpm struggle/fail with the flow file pretending to be js. It's weird that https://github.com/facebook/react-native/blob/main/packages/polyfills/error-guard.js has flow type annotations, while it's sibling https://github.com/facebook/react-native/blob/main/packages/polyfills/console.js has none. Would it be an option to remove the flow types from Probably not by itself, since other files import types from this polyfill: react-native/Libraries/vendor/core/ErrorUtils.js
Importing anything from a polyfill(?) seems pretty strange. |
@waganse I don't think the change is a correct change. The paths aren't matching the right format, and changing it to that is basically the same as setting The pattern that pnpm (and npm) use for node_modules is roughly this:
We must filter out the "starting" Maybe something like this could work, but haven't tested it:
|
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. |
This issue was closed because it has been stalled for 7 days with no activity. |
Description
Jest tests runs successfully after installing the dependencies using npm install but fails after using pnpm install .
Full error message :
Project structure :
package.json :
babel.config.js :
app.test.js :
React Native Version
0.71.5
Output of
npx react-native info
Steps to reproduce
pnpm install
pnpm run test
Snack, code example, screenshot, or link to a repository
Stackoverflow
The text was updated successfully, but these errors were encountered: