simple-i18n-example icon indicating copy to clipboard operation
simple-i18n-example copied to clipboard

Deploy Issue

Open CreativExit opened this issue 4 years ago • 4 comments

Hi, i try to deploy to Netlify:

"scripts": { "dev": "next", "build": "next build && next export", "start": "serve ./out", "lint": "eslint . --ext .ts,.tsx" }

But don't works. Any idea?

Thanks

CreativExit avatar Apr 28 '20 04:04 CreativExit

I haven't tried deploying it to Netlify specifically. Please keep in mind that the version of the app in the repo is a server rendered application. You can deploy it to Now, since they know how to turn the server requirement of the app into a serverless lambda function automatically, but with Netflify you'd have to find out a way to get a server running in the background somehow. Just serving the static files from ./out is not enough to get the app running -- unless you've converted it to a fully SSG app that is...

fwojciec avatar Apr 28 '20 08:04 fwojciec

Sorry, I don't understand the question...

fwojciec avatar Apr 28 '20 12:04 fwojciec

Ok, i need use simple-i18n in a Next Server Side Rendering project. Is that possible?

Thanks

CreativExit avatar Apr 28 '20 12:04 CreativExit

The example as written currently is written as a Server Sendered App (i.e. the app is run by running a server which needs a server process running (using next start) for the web app to be accessible.

It's also possible to use this approach with only small modifications if you want to pre-render all pages at build time -- see this issue/comment for some discussion on how to implement it: https://github.com/fwojciec/simple-i18n-example/issues/5#issuecomment-615478032 If you choose SSG (server side generated) approach you should be able to deploy to Netlify similar to how you were trying to do in the initial post.

fwojciec avatar Apr 28 '20 13:04 fwojciec