Closed
Description
Provide a general summary of the issue here
I have an error
Error: Unable to resolve module @swc/helpers/cjs/_class_private_field_init.cjs from /Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/@react-aria/interactions/dist/main.js: @swc/helpers/cjs/_class_private_field_init.cjs could not be found within the project or in these directories:
node_modules
../node_modules
../../../node_modules
2 | var $goTMa$react = require("react");
3 | var $goTMa$swchelperscjs_class_private_field_getcjs = require("@swc/helpers/cjs/_class_private_field_get.cjs");
> 4 | var $goTMa$swchelperscjs_class_private_field_initcjs = require("@swc/helpers/cjs/_class_private_field_init.cjs");
| ^
5 | var $goTMa$swchelperscjs_class_private_field_setcjs = require("@swc/helpers/cjs/_class_private_field_set.cjs");
6 | var $goTMa$reactariassr = require("@react-aria/ssr");
7 |
at ModuleResolver.resolveDependency (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:15)
at DependencyGraph.resolveDependency (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
at Object.resolve (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/lib/transformHelpers.js:129:24)
at resolve (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
at /Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
at Array.reduce (<anonymous>)
at resolveDependencies (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
at processModule (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
at async addDependency (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
at async Promise.all (index 2)
Not sure if some libraries connected to another libraries
but im using native-base
Im not using @swc/helpers
🤔 Expected Behavior?
it should be work and not having an error I also try to path but it show well in vscode.
😯 Current Behavior
Error: Unable to resolve module @swc/helpers/cjs/_class_private_field_init.cjs from /Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/@react-aria/interactions/dist/main.js: @swc/helpers/cjs/_class_private_field_init.cjs could not be found within the project or in these directories:
node_modules
../node_modules
../../../node_modules
2 | var $goTMa$react = require("react");
3 | var $goTMa$swchelperscjs_class_private_field_getcjs = require("@swc/helpers/cjs/_class_private_field_get.cjs");
> 4 | var $goTMa$swchelperscjs_class_private_field_initcjs = require("@swc/helpers/cjs/_class_private_field_init.cjs");
| ^
5 | var $goTMa$swchelperscjs_class_private_field_setcjs = require("@swc/helpers/cjs/_class_private_field_set.cjs");
6 | var $goTMa$reactariassr = require("@react-aria/ssr");
7 |
at ModuleResolver.resolveDependency (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:15)
at DependencyGraph.resolveDependency (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
at Object.resolve (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/lib/transformHelpers.js:129:24)
at resolve (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
at /Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
at Array.reduce (<anonymous>)
at resolveDependencies (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
at processModule (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
at async addDependency (/Users/mrv/Desktop/Projects/art-hearts-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
at async Promise.all (index 2)
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
hmmmm I just run the app it tells me the error its your library ???
Version
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
mbp m2
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Activity
reidbarber commentedon Aug 10, 2023
Can you specify which version of React Aria you're using, and which build tool you're using for your app?
jakecrump commentedon Aug 10, 2023
Having the same issue. Unsure if it impacts other packages but specifically for me,
@react-aria/button
version3.8.1
is causing the above error. I added an override to an earlier version (3.8.0) and the error goes away.edit: upon further investigating, seems outside of the
button
component. Apologies.michaelroevievictoria commentedon Aug 10, 2023
@reidbarber Im using react-native, actually im not sure why the error comes on this library I have already suspected that this issue is within the native-base but I try to bump up the library but the error goes still the same .
michaelroevievictoria commentedon Aug 10, 2023
Added info
reidbarber commentedon Aug 10, 2023
@jakecrump which build tool and version are you using for your app? Does this happen to be an older version of Next.js?
reidbarber commentedon Aug 10, 2023
@michaelroevievictoria is this using Expo? If so, which version?
michaelroevievictoria commentedon Aug 10, 2023
@reidbarber im using react native cli
jakecrump commentedon Aug 10, 2023
Yeah, it's Next
12.3.2
(updating to 13 is not possible at this time)LFDanLu commentedon Aug 10, 2023
I believe this issue is the same as this one, see this comment for more details.
jakecrump commentedon Aug 10, 2023
Since it's a third-party module for my case, I'm unable to manually downgrade (for now). Fortunately, adding this override to the package.json seems to work until a more permanent solution can be explored.
devongovett commentedon Aug 10, 2023
Seems like two different issues? One is for Next.js, which we know about already, and the other is for React Native? For the React Native folks, could you verify what version of
@swc/helpers
is installed? Maybe try clearing it from your lockfile and reinstalling?jakecrump commentedon Aug 10, 2023
For what its worth (On the Next js side of this issue), we're generating, cloning, and installing Next 12.3.2 apps on a daily basis, and I can confirm this was not an issue yesterday (I did several installs yesterday with fresh package-locks, the whole works). So if the issue thread from last month that @LFDanLu shared earlier is in fact what's happening, I'm guessing this latest release is just a continuation of losing Next 12 support and we were just lucky until now?
dcisneros2 commentedon Aug 10, 2023
The issue is happening on react-native, started last night since builds were working before, looks like it lines up with react-aria/interactions update. Not using dependency directly but react-native-base uses it.
@swc/helpers version referenced is 0.51.0, but this we are also not using directly.
devongovett commentedon Aug 10, 2023
Looking inside
@swc/helpers
, it looks like the requested file does exist: https://unpkg.com/browse/@swc/helpers@0.5.1/cjs/_class_private_field_init.cjsCan you verify what version of Metro bundler you are using? Looks like
.cjs
file support was added around a year ago in 0.72.0. facebook/metro#535devongovett commentedon Aug 10, 2023
Oh, looks like at least one of you is using react-native 0.69.3 according to the above comment. That version is over a year old and marked as deprecated on npm: https://www.npmjs.com/package/react-native/v/0.69.3. Looks like it is also using an old version of metro from before
.cjs
support was added. Any chance you can upgrade your version?14 remaining items