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

Upgrade NextJs to v 12 #894

Open
sparrowDom opened this issue Feb 1, 2022 · 11 comments
Open

Upgrade NextJs to v 12 #894

sparrowDom opened this issue Feb 1, 2022 · 11 comments
Assignees
Labels
dapp Relating to OUSD.com enhancement New feature or request good first issue Good for newcomers P3 Users are not significantly affected, minor cosmetic issue

Comments

@sparrowDom
Copy link
Member

Version 12 brings some cool things to the table: https://nextjs.org/blog/next-12.
One of the better things is, it upgrades compiler to rust and is said to be 3x-5x faster. That should be moderately beneficial improving the speed when developing new features.

@sparrowDom sparrowDom added dapp Relating to OUSD.com enhancement New feature or request good first issue Good for newcomers P3 Users are not significantly affected, minor cosmetic issue labels Feb 1, 2022
@RishiKumarRay
Copy link

what are the things we will need to update?

@sparrowDom
Copy link
Member Author

sparrowDom commented Feb 4, 2022

I would start with updating next dependancy in dapp/package.json to latest 12.x version. And then start solving errors that upgrade causes.

I've quickly attempted this upgrade some time ago, but a lot of errors have surfaced from the next configuration file. I figured that will not be a sub 1 hour task and left it at that.

@franckc
Copy link

franckc commented Feb 23, 2022

@gurucrypto23 Mentioned in discord he is going to take a stab at this issue...

@aglamadrid19
Copy link

I'm also going to take a stab at this, Next or react isn't my strongest arm but this seems to be a good issue to at least get the dev environment running.

@sparrowDom
Copy link
Member Author

@aglamadrid19 that would be awesome.

@aglamadrid19
Copy link

aglamadrid19 commented Mar 18, 2022

After upgrading react (v17) and next (v12) , webpack schema seems to be incompatible and it seems webpack 5 is required. Also webpack5: false flag has been disabled on Next12

Links I followed:
https://nextjs.org/docs/upgrading
https://nextjs.org/docs/messages/webpack5

image
image

Need guidance on how to move from here.

Im guessing next step is how we upgrade from webpack 4 to webpack 5, but I'm not sure how to proceed.

@sparrowDom
Copy link
Member Author

I would guess that next has some webpack logic bundled into it. The webpack like configuration that next uses is present in next.config.js. The error it seems to be complaining about is fs (file system configuration): https://github.com/OriginProtocol/origin-dollar/blob/master/dapp/next.config.js#L37

Though as the comment in that line points out that override was needed to fix some problems with NPM packages expecting to be able to import fs module.

This is a tricky issue to solve. Last time I gave it a quick attempt it was throwing similar errors. Not sure how to continue, since I got stuck at a similar point.

@aglamadrid19
Copy link

aglamadrid19 commented Mar 21, 2022

My best shot for moving forward here is to take this issue to the following:

1 - Take it to the webpack community hoping they can lead us in the right direction.
2 - Take it to the NextJS community hoping they can lead us in the right direction.
3 - Open StackOverflow question

I will perform all 3 and update this issue with all relevant information. Please let me know if this you agree proceeding this way.

@aglamadrid19
Copy link

StackOverflow:
https://stackoverflow.com/questions/71562029/nextjs-12-and-webpack-5-unknown-property-fs

Webpack Gitter:
image

NextJS Question:
vercel/next.js#35500

If anyone has any feedback please feel free to share it.

@sparrowDom
Copy link
Member Author

I see you got some replies to your question @aglamadrid19. Sorry for late reply was OOO last week. I would say feel free to proceed in any way you see fit in order to make progress / get to a solution.

@franckc
Copy link

franckc commented Jun 6, 2022

Unassigning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dapp Relating to OUSD.com enhancement New feature or request good first issue Good for newcomers P3 Users are not significantly affected, minor cosmetic issue
Projects
Status: Backlog
Development

No branches or pull requests

6 participants
@sparrowDom @franckc @aglamadrid19 @RishiKumarRay @wonjun-opensource and others