1

I have a react web app with Next.Js. I want To upload it on my IIS ftp. Should I copy .next folder? If yes, Why I get error on this case?

Error screenshot:

enter image description here

autopilot
  • 352
  • 2
  • 4
  • 18
Mahdi
  • 228
  • 1
  • 3
  • 12
  • I have answered in https://stackoverflow.com/questions/56779064/deploying-next-js-project-in-iis – Andy Ho Jul 27 '20 at 07:06

2 Answers2

0

add this to your package.json scripts : "prod": "next export" and after building run this script then copy the output folder : /out

Alwani Anis
  • 210
  • 3
  • 10
-1

To run node js app on iis you need to configure the iisnode module. https://github.com/tjanczuk/iisnode

then run below command to build the application:

npm run build

which creates the production application in the .next folder.

https://nextjs.org/docs/advanced-features/static-html-export

Jalpa Panchal
  • 6,621
  • 1
  • 7
  • 21
  • I copied .next forlder to wwwroot. but web.config is not ok. because i got HTTP ERROR 500. – Mahdi May 04 '20 at 07:35
  • @Mahdi you no need to copy the folder. could you please share the detailed error message snapshot? – Jalpa Panchal May 04 '20 at 08:01
  • I added image to question – Mahdi May 05 '20 at 00:37
  • after next export I got this error: Error for page /users/[userId]: pages with `getServerSideProps` can not be exported – Mahdi May 05 '20 at 08:50
  • @Mahdi this is next js error use getInitialProps instead of getServerSideProps. https://stackoverflow.com/questions/61354282/pages-with-getserversideprops-can-not-be-exported – Jalpa Panchal Jun 04 '20 at 09:54