react-tournament-brackets icon indicating copy to clipboard operation
react-tournament-brackets copied to clipboard

Update webpack config for both browser and Node.js (incl. Next.js)

Open zarganum opened this issue 2 years ago • 12 comments

This will resolve the #34, #51 and potentially many others. https://webpack.js.org/configuration/output/#outputglobalobject

The dynamic imports "workaround" in #34 prevents our npm run build and thus blocks the whole dev pipeline.

May I also suggest to review the current versions as some of them are 2+ years old.

Meanwhile (if anyone else is suffering from the same issue): in your text editor, open the node_modules/@g-loot/react-tournament-brackets/dist/bundle.js and add just one line in the very beginning:

const window = global.window;

many thanks

zarganum avatar Aug 25 '23 08:08 zarganum

@zarganum confirmed fix, can we merge and re-release, this is a fairly urgent bug haha (@Shenato)

UTkzhang avatar Sep 05 '23 01:09 UTkzhang

@zarganum will the merge be soon? because it is needed :(

notShadowM avatar Sep 26 '23 12:09 notShadowM

@zarganum will the merge be soon? because it is needed :(

I'd be more than happy... but I'm not the owner of this repo and not having write permissions, pls. ask @Shenato

zarganum avatar Sep 26 '23 17:09 zarganum

Are you certain this doesn't have any drawbacks to how the library is compiled?

Have you tested it with non-nextjs projects. Like the main target this library has which is regular client side react libraries?

I have very little experience with this particular change in web pack so I would like confirmation with some end user testing that it works for client side rendering and server side as well.

Shenato avatar Sep 26 '23 17:09 Shenato

I need this! I can't use this on Next.js without this update + the window config...

feldrok avatar Oct 21 '23 13:10 feldrok

While this gets merged, can someone please point out how to importa the forked repo? Is that possible since they have the same pacakge name and I am not being able to import normally or with the full user/repo format.

arathael avatar Oct 23 '23 23:10 arathael

While this gets merged, can someone please point out how to importa the forked repo? Is that possible since they have the same pacakge name and I am not being able to import normally or with the full user/repo format.

Haven't been able to do it, Vercel installs the package from npm. A workaround for this would be great.

feldrok avatar Nov 24 '23 02:11 feldrok

Hey guys, Sorry for the late response, I wasn't sure this change was what was needed for the package overall, so I went ahead and migrated the package to not be compiled as a better way to make sure it supports nextjs and is more aligned with how packages today are built and so on

Please let me know if this PR fixes it https://github.com/g-loot/react-tournament-brackets/pull/64

You can easily test it by npm installing this beta release https://www.npmjs.com/package/@g-loot/react-tournament-brackets/v/1.0.31-rc

Shenato avatar Dec 04 '23 19:12 Shenato

Hey! Just a quick reminder to the great devs who have developed this library about the open issue. Would love to integrate this library into my Next/React app but hesitant to given any further issues that may have developed in the last 6 months.

reckziegelwilliam avatar Jun 04 '24 05:06 reckziegelwilliam

Hey! Just a quick reminder to the great devs who have developed this library about the open issue. Would love to integrate this library into my Next/React app but hesitant to given any further issues that may have developed in the last 6 months.

Hey this library has moved to be under my personal github, because the organization that it is under now is no more. So they've kicked every dev out of the organizing which means no one can contribute to this repo as of today.

I'll try to get this particular fix merged under my own fork of this repo and publish some details on how to swap packages soon. Hopefully this weekend.

Shenato avatar Aug 08 '24 17:08 Shenato

https://github.com/Shenato/react-tournament-brackets

This is where the package lives now.

Please check it out and give me feedback if you're able to install the new package. It no longer has the @g-loot/ prefix.

Shenato avatar Aug 08 '24 17:08 Shenato

Try installing this package instead and see if it works with you guys on next.js

https://www.npmjs.com/package/react-tournament-brackets

Shenato avatar Aug 09 '24 18:08 Shenato