Skip to content

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 #4894

Closed
@michaelroevievictoria

Description

@michaelroevievictoria

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

reidbarber commented on Aug 10, 2023

@reidbarber
Member

Can you specify which version of React Aria you're using, and which build tool you're using for your app?

jakecrump

jakecrump commented on Aug 10, 2023

@jakecrump

Having the same issue. Unsure if it impacts other packages but specifically for me, @react-aria/button version 3.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

michaelroevievictoria commented on Aug 10, 2023

@michaelroevievictoria
Author

@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 .

image

Can you specify which version of React Aria you're using, and which build tool you're using for your app?

michaelroevievictoria

michaelroevievictoria commented on Aug 10, 2023

@michaelroevievictoria
Author

Added info

image

image

reidbarber

reidbarber commented on Aug 10, 2023

@reidbarber
Member

@jakecrump which build tool and version are you using for your app? Does this happen to be an older version of Next.js?

reidbarber

reidbarber commented on Aug 10, 2023

@reidbarber
Member

@michaelroevievictoria is this using Expo? If so, which version?

michaelroevievictoria

michaelroevievictoria commented on Aug 10, 2023

@michaelroevievictoria
Author

@reidbarber im using react native cli

"react-native": "0.69.3",
"native-base": "3.2.2-rc.3",
jakecrump

jakecrump commented on Aug 10, 2023

@jakecrump

@jakecrump which build tool and version are you using for your app? Does this happen to be an older version of Next.js?

Yeah, it's Next 12.3.2 (updating to 13 is not possible at this time)

LFDanLu

LFDanLu commented on Aug 10, 2023

@LFDanLu
Member

I believe this issue is the same as this one, see this comment for more details.

jakecrump

jakecrump commented on Aug 10, 2023

@jakecrump

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.

  "overrides": {
    "@react-aria/interactions": "3.16.0"
  }
devongovett

devongovett commented on Aug 10, 2023

@devongovett
Member

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

jakecrump commented on Aug 10, 2023

@jakecrump

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

dcisneros2 commented on Aug 10, 2023

@dcisneros2

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

devongovett commented on Aug 10, 2023

@devongovett
Member

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.cjs

Can 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#535

devongovett

devongovett commented on Aug 10, 2023

@devongovett
Member

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @devongovett@jakecrump@michaelroevievictoria@reidbarber@LFDanLu

        Issue actions

          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 · Issue #4894 · adobe/react-spectrum