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

error TS2309: An export assignment cannot be used in a module with other exported elements. #978

Closed
vsbharath opened this issue Dec 9, 2023 · 12 comments

Comments

@vsbharath
Copy link

🐛 Bug Report

After Upgrading to latest react and react-joyride. Seeing issues while tunning yarn tsc

node_modules/react-joyride/dist/index.d.ts:295:1 - error TS2309: An export assignment cannot be used in a module with other exported elements.

295 export = Joyride

To Reproduce

Upgrade React to latest

Expected behavior

@vsbharath
Copy link
Author

vsbharath commented Dec 9, 2023

Using

node -v
v16.20.2

"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17"
typescript@4.9.5

@vsbharath
Copy link
Author

@gilbarbara Can you please help here ?

@gilbarbara
Copy link
Owner

gilbarbara commented Dec 11, 2023

Hey @vsbharath

Please provide a https://codesandbox.io/ demo or similar.
Issues without a reproduction link are likely to stall.

Also, which versions do you have for react and react-joyride.

@vsbharath
Copy link
Author

here are the version that I'm using
"react-joyride": "2.7.0",
"react": "18.2.0",

Even upgrading to latest 2.7.0 running tsc is failing for react-joyride

@vsbharath
Copy link
Author

Is see in react-joyride/dist/index.d.ts

two exports with the same file

and Joyride as decalred as default and not sure why it is generated another export = JoyRide at the end of the file. After removing this line from node_modules it worked. Can you please help how this file is generated?

@matthiasschwarz
Copy link

I have the same issue when using versions above 2.5.5.
I downgraded the library to version 2.5.5 and the build error was gone.

@matthiasschwarz
Copy link

After some investigation i found out that the issue comes from using fix-tsup-cjs in the build process which creates the duplicate export.
Is the use of fix-tsup-cjs necessary?

@gilbarbara
Copy link
Owner

Does setting "skipLibCheck" to true in your tsconfig fixes the problem?

@vsbharath
Copy link
Author

vsbharath commented Dec 18, 2023 via email

@gilbarbara
Copy link
Owner

Weird.
Anyway, I already have a fix for this in #979
Just fixing some scroll issues and I'll merge it soon.

@gilbarbara
Copy link
Owner

@vsbharath @matthiasschwarz
Can you try this version and report back?
npm i react-joyride@next

Thanks

@matthiasschwarz
Copy link

Issue is resolved for me with version 2.7.2.
Thanks

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

No branches or pull requests

3 participants