gilbarbara / react-joyride

Create guided tours in your apps
https://react-joyride.com/
MIT License
6.62k stars 519 forks source link

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

Closed vsbharath closed 5 months ago

vsbharath commented 7 months ago

🐛 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 commented 7 months ago

Using

node -v v16.20.2

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

vsbharath commented 6 months ago

@gilbarbara Can you please help here ?

gilbarbara commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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

vsbharath commented 6 months ago

No, skipLibCheck is not fixing the problem as the library it is being called from other files that are included under tsc config. If I just remove the duplicate line generated from the generated file. it works.

On Mon, Dec 18, 2023 at 10:25 AM Gil Barbara @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/gilbarbara/react-joyride/issues/978#issuecomment-1861266261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIG5O5WKCMRLEIERVR4HIZDYKCDDFAVCNFSM6AAAAABANMNDVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRRGI3DMMRWGE . You are receiving this because you were mentioned.Message ID: @.***>

gilbarbara commented 6 months ago

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

gilbarbara commented 6 months ago

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

Thanks

matthiasschwarz commented 5 months ago

Issue is resolved for me with version 2.7.2. Thanks