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

No matching export for import "getSyntheticLinkProps" #6750

Closed
IvanHoliak opened this issue Jul 22, 2024 · 34 comments · Fixed by #6755
Closed

No matching export for import "getSyntheticLinkProps" #6750

IvanHoliak opened this issue Jul 22, 2024 · 34 comments · Fixed by #6755

Comments

@IvanHoliak
Copy link

Provide a general summary of the issue here

After updating the @nextui-org/react package to 2.4.6, the @react-aria/utils dependency was updated to 3.25.0. There was a problem importing into @react-aria/utils. This is why the project is not deployed to AWS Amplify and there is no way to continue developing the project!

image
image

🤔 Expected Behavior?

Everything should work as it did on the previous version @react-aria/utils 3.24.1

😯 Current Behavior

The project does not start and does not build

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

  1. yarn remove @nextui-org/react
  2. yarn add @nextui-org/react
  3. yarn dev

Version

3.25.0 @react-aria/utils

What browsers are you seeing the problem on?

Chrome, Other

If other, please specify.

No response

What operating system are you using?

MacOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@snowystinger
Copy link
Member

snowystinger commented Jul 22, 2024

I think you possibly have multiple copies of our packages installed. Could you check that is the case? it usually manifests as a node_modules inside of a package already in your node_modules. There's also this script https://gist.github.com/jluyau/9024db3527788030312332075745469b which may help you identify duplicates.

Another option is that you need to update some of the other packages, such as react-aria/menu or react-aria/gridlist

@abraira85
Copy link

I have the same error

@theonlyway
Copy link

theonlyway commented Jul 23, 2024

I'm guessing we are all using Next UI at least with Next.js the import trace seems a bit more helpful. Given Next UI is the common denominator I would hazard it's probably a problem with that.

./node_modules/@react-aria/table/dist/useTableRow.mjs
Attempted import error: 'getSyntheticLinkProps' is not exported from '@react-aria/utils' (imported as '$2K6sg$getSyntheticLinkProps').

Import trace for requested module:
./node_modules/@react-aria/table/dist/useTableRow.mjs
./node_modules/@react-aria/table/dist/import.mjs
./node_modules/@nextui-org/table/dist/chunk-IZM76DYO.mjs
./node_modules/@nextui-org/table/dist/index.mjs
./components/admin/rootLayout.tsx

@AmazingTurtle
Copy link

I was still in 2.4.2 and got the same error without updating. Was my CI pipeline broken all the time and I didn't know it or this isn't my fault? :D

@IvanHoliak
Copy link
Author

I was also using version 2.4.2 and did not update it, I noticed this error when I deployed an update to my app on aws amplify. Then I decided to update all versions of the packages to the latest and the error began to appear no matter what version I installed. I don't have duplicate packages, I'm sure of that!

@AmazingTurtle
Copy link

Anyone else using turbo in this setup? Is this possibly related to turbo?

@theonlyway
Copy link

No Turbo for me

@mmmmmob
Copy link

mmmmmob commented Jul 23, 2024

I got this same error message as well when deploying on Vercel 😰

@wingkwong
Copy link

@IvanHoliak

After updating the @nextui-org/react package to 2.4.6, the @react-aria/utils dependency was updated to 3.25.0.

this looks weird since we use the fixed version for @react-aria/utils@3.24.1 as well as for other RA dependencies.

@Pewtro
Copy link

Pewtro commented Jul 23, 2024

I am also facing this issue (not using next-ui), it seems that @react-aria/utils@3.25.0 in general is broken.
The script proposed by @snowystinger reports no duplicates in package-lock.

@AmazingTurtle
Copy link

Boiled it down to this commit.
a4dee6e

Apparently getSyntheticLinkProps was renamed to useSyntheticLinkProps.
That on it's own shouldn't cause so much trouble as nextui refers to the 3.24.1 version which was released 2 months ago. Makes me wonder why 3.5.0 is used in nextui builds. More specifically in docker builds, as on my local machine with my yarn.lock unchanged, this problem does not occur but only in my Dockerfile.

In my specific use case, I was using turbo which produced a malformed yarn.lock which would be dirty on yarn install --immutable. I opted out of turbo and manually added all packages/ and apps/ package.jsons.

Either way if it's broken on your local machines it helps to do yarn why @react-aria/utils to see why it is using 3.5.0 perhaps. On my CI machine, turbo was to blame.

@Pewtro
Copy link

Pewtro commented Jul 23, 2024

Something like that is a breaking change, especially when combined with the usage of ^ when referring to that dependency, it means that freshly grabbing (or deduping) packages like @react-aria/gridlist@3.8.1 will install @react-aria/utils@3.25.0 because the dependency refers to "@react-aria/utils": "^3.24.1",, and then build will be broken.

@SunnyHiStroke
Copy link

"After updating to Next.js 3.25, I am encountering an issue when creating a build. Please suggest how to fix it."

Errors:-
Invalid next.config.js options detected:
⚠ Unrecognized key(s) in object: 'sentry'
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
▲ Next.js 14.2.5

  • Environments: .env.local, .env.production

Creating an optimized production build ...
Failed to compile.

./node_modules/@react-aria/table/dist/useTableRow.mjs
Attempted import error: 'getSyntheticLinkProps' is not exported from '@react-aria/utils' (imported as '$2K6sg$getSyntheticLinkProps').

Import trace for requested module:
./node_modules/@react-aria/table/dist/useTableRow.mjs
./node_modules/@react-aria/table/dist/import.mjs
./node_modules/@nextui-org/table/dist/chunk-IZM76DYO.mjs
./node_modules/@nextui-org/table/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./app/error.tsx

@tomd-thehistroke
Copy link

tomd-thehistroke commented Jul 23, 2024

Same error getting from this morning

Failed to compile

Next.js (14.2.5)
./node_modules/@react-aria/table/dist/useTableRow.mjs
Attempted import error: 'getSyntheticLinkProps' is not exported from '@react-aria/utils' (imported as '$2K6sg$getSyntheticLinkProps').

@react-aria/utils twice installed into my project. it is a peer dependence of @nextui-org/react, @nextui-org/system, @nextui-org/theme

@react-aria/utils (2) - 3.24.1, 3.25.0

Any solution for this. We are stuck of production

@wingkwong
Copy link

wingkwong commented Jul 23, 2024

Something like that is a breaking change, especially when combined with the usage of ^ when referring to that dependency, it means that freshly grabbing (or deduping) packages like @react-aria/gridlist@3.8.1 will install @react-aria/utils@3.25.0 because the dependency refers to "@react-aria/utils": "^3.24.1",, and then build will be broken.

Supplement a bit. In our NextUI table component, we are using the fixed version for RA table (v3.14.1)

"dependencies": {
  "@react-aria/table": "3.14.1",
   // some other dependencies ...
}

In @react-aria/table@3.14.1, it uses @react-aria/grid@^3.9.1

"node_modules/@react-aria/table": {
  "version": "3.14.1",
  "dependencies": {
    "@react-aria/grid": "^3.9.1",
     // some other dependencies ...
  },
}

Due to the caret (^), @react-aria/grid": "^3.9.1" will resolve to @react-aria/grid@3.10.0 which was released yesterday.

"node_modules/@react-aria/grid": {
  "version": "3.10.0",
  "dependencies": {
    "@react-aria/utils": "^3.25.0",
     // some other dependencies ...
  },
}

and the breaking change was introduced in @react-aria/utils@3.25.0

@davidbonan
Copy link

That means all previous versions of React-aria are broken due to the poor version management of the React-aria monorepo ?

@itsberkelium
Copy link

@wingkwong should we expect a fix from react-aria or NextUI?

@yuliahey
Copy link

As a temporary fix, you can specify the older version in a package.json

"resolutions": { "@react-aria/utils": "3.24.1" }

@Pewtro
Copy link

Pewtro commented Jul 23, 2024

As a temporary fix, you can specify the older version in a package.json

"resolutions": { "@react-aria/utils": "3.24.1" }

This will only work if you also lock other @react-aria/* packages (and any transitive dependencies) to install versions that do not depend on the 3.25.0 version, as otherwise you'll be at risk of getting the inverse error.

@tejaslende
Copy link

Issue: Build Error Due to Import Error with @react-aria/utils
Description:

When building the project, I'm encountering the following errors:

Image Optimization Warning:
youtube:build: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
This indicates that the sharp package is missing for image optimization in production.

Build Failure Due to Import Error:

bash
Copy code
master:build: Failed to compile.

build: ../../node_modules/@react-aria/table/dist/useTableRow.mjs
master:build: Attempted import error: 'getSyntheticLinkProps' is not exported from '@react-aria/utils' (imported as '$2K6sg$getSyntheticLinkProps').

: Import trace for requested module:
: ../../node_modules/@react-aria/table/dist/useTableRow.mjs
: ../../node_modules/@react-aria/table/dist/import.mjs

Steps to Reproduce:

Install dependencies using Yarn.
Run the build command (yarn build).
Observe the errors during the build process.
Expected Behavior:

The build should complete successfully without import errors related to @react-aria/utils.

Actual Behavior:

The build fails with an import error for getSyntheticLinkProps, which is not exported from @react-aria/utils.

Additional Context:

Packages Involved:
@react-aria/utils (version 3.24.1)
@nextui-org/react and related NextUI packages
Reference: Next.js Documentation on Sharp
Possible Solution:

It appears that getSyntheticLinkProps might have been removed or renamed in the latest version of @react-aria/utils. Updating to a compatible version or checking the latest documentation for alternative imports might resolve the issue.

@LiGo666
Copy link

LiGo666 commented Jul 23, 2024

same issue here

@neonn0d
Copy link

neonn0d commented Jul 23, 2024

Any hope :D?

@devongovett
Copy link
Member

devongovett commented Jul 23, 2024

Hmm, interesting issue. I think we were under the impression that since this is an internal/private package, breaking changes were ok, but clearly that's not the case due to pinning of upstream dependencies. Sorry about that.

I guess we could potentially bring back the old version of the function and leave it there alongside the new one. In this case the function is quite small. We will check to see if there are any more like this as well.

@7laria
Copy link

7laria commented Jul 23, 2024

same here

@wingkwong
Copy link

wingkwong commented Jul 23, 2024

Solved here nextui-org/nextui#3537

That's not correct. That PR was experimental and somehow it got merged by mistake. We've rollbacked it. We'll wait for RA team's updates and at the same time we're trying to upgrade to RA latest and resolve the build issues.

@itsberkelium
Copy link

Solved here nextui-org/nextui#3537

That's not correct. That PR was experimental and somehow it got merged by mistake. We've rollbacked it. We'll wait for RA team's updates and at the same time we're trying to upgrade to RA latest and resolve the build issues.

I tried it earlier once I saw this PR. Forgot I have added resolutions as a temp solution. My bad.

@7laria
Copy link

7laria commented Jul 23, 2024

still happening

@devongovett
Copy link
Member

hold your horses, I'm still working on releasing the fix to npm 😅

@iYonga
Copy link

iYonga commented Jul 23, 2024

Waiting patiently.

@ImreAngelo
Copy link

As a temporary fix, you can specify the older version in a package.json
"resolutions": { "@react-aria/utils": "3.24.1" }

This will only work if you also lock other @react-aria/* packages (and any transitive dependencies) to install versions that do not depend on the 3.25.0 version, as otherwise you'll be at risk of getting the inverse error.

You can also specify versions below 3.25.0 in case some package depends on an older version:

"resolutions": { "@react-aria/utils": "<3.25.0" }

@Jose1i1o
Copy link

As a temporary fix, you can specify the older version in a package.json

"resolutions": { "@react-aria/utils": "3.24.1" }

This worked on my end. Thanks for the heads up @yuliahey

Jose1i1o added a commit to Jose1i1o/bemobile-marvel-challenge that referenced this issue Jul 23, 2024
@devongovett
Copy link
Member

devongovett commented Jul 24, 2024

This should be fixed in @react-aria/utils v3.25.1. Sorry for the bug and thanks for your patience.

@wingkwong
Copy link

@devongovett Thanks a lot!

@tejaslende
Copy link

Build Error Due to Import Error with @react-aria/utils - Solution Found

Description:

When building my project, I encountered errors related to imports from @react-aria/utils. Specifically, the build failed due to an import error for getSyntheticLinkProps.

Errors Encountered:

Failed to compile.

../../node_modules/@react-aria/table/dist/useTableRow.mjs
Attempted import error: 'getSyntheticLinkProps' is not exported from '@react-aria/utils' (imported as '$2K6sg$getSyntheticLinkProps').

Import trace for requested module:
../../node_modules/@react-aria/table/dist/useTableRow.mjs
../../node_modules/@react-aria/table/dist/import.mjs
Solution:

I resolved the issue by ensuring the following package versions:

"@nextui-org/react": "2.2.10"
@nextui-org/react: 2.2.10
@react-aria/utils: 3.24.1

Steps Taken:

1: use nextUI version "@nextui-org/react": "2.2.10",
2: yarn cache clean
3: yarn node_module delete
4: yarn.locak file delete
5: yarn install

Ran the build command (yarn build) successfully.
Additional Context:

This solution addresses the import error by using compatible versions of the involved packages. If you encounter similar issues, aligning your package versions as shown above might help resolve them.

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 a pull request may close this issue.