Can Next easily be hosted on Netlify?
I have seen some mention of it in old issues from around a year ago, but wasn't fully clear if they work well together yet or not.
I'm assuming this is similar to hosting on GitHub pages, so I would hope the answer for Netlify is also a yes, but doesn't seem to be too popular an option for some reason and don't see much about it when doing a Google search.
So in short, is it possible to host Next on Netlify?
Do you lose out on any features by doing so?
AFAIK Netlify is only for static sites, so it should be possible if you use next export to create an static site as with GitHub Pages.
Exactly what @sergiodxa is saying 馃檹
Hello,
I'm trying to host my next app on Netlify but I have some issues with next export
I think it's due to es6, I have the following output:
...
(function (exports, require, module, __filename, __dirname) { import _ from 'lodash'
^^^^^^
SyntaxError: Unexpected token import
...
This is my .babelrc config:
{
"presets": ["env", "next/babel"]
}
I really don't want to make some ugly hack with require :D
Thanks,
never put "env" in .babelrc when using Next, it's part of next/babel.
Ok thanks for that, I just remove it but same issue :)
If you can provide a minimal reproduction I can look into it 馃憤
Hello, you can check a simple repo here: https://github.com/majdi/next.js-issue.git
Actually, I need the "env" in my .babelrc to run the yarn dev command.
You can see that yarn build or yarn export fail because of import things.
Thanks :)
How has this changed since netlify now supports lambda functions out of the box?
Hi, I didn't retry and host with now but I think it can works now :)
[ I removed my testing repository ]
Most helpful comment
Hello,
I'm trying to host my next app on Netlify but I have some issues with
next exportI think it's due to es6, I have the following output:
This is my .babelrc config:
I really don't want to make some ugly hack with require :D
Thanks,