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

How to deploy to Now? #258

Open
Koli14 opened this issue Feb 5, 2020 · 2 comments
Open

How to deploy to Now? #258

Koli14 opened this issue Feb 5, 2020 · 2 comments

Comments

@Koli14
Copy link

Koli14 commented Feb 5, 2020

Steps I made:

  • Cloning the repo
  • Change wpUrl to my live WP site in the frontend/config.js file
  • copied the DB, the plugins, the theme and the uploads to my live WP site from wp-headless and db-headless
  • run yarn && yarn build from the frontend directory, and deployed it to Now with now --prod
  • changed the frontend-origin.php in the postlight-headless-wp theme in my live WP site to point to https://frontend.koli14.now.sh, where I deployed the frontend.
    After these steps the front page is working as expected, but if I click on any internal URL, it says:

An unexpected error has occurred.

After refreshing:

404 - This page could not be found.

Any idea, what did I missed, or how can I debug it?
Thanks!

@Tristan-Tornatore
Copy link

I've the same issue, any one have an idea ?
Thanks a lot !

@hudsonandtask
Copy link

@Koli14 @Tristan-Tornatore I got this to work using Now V2 and the headless-starter.

I changed wpUrl to my live WP site URL in the frontend/config.js file

I copied the DB, the plugins, the theme and the uploads to my live WP site using All-in-One wordpress migration plug in.

I did NOT run a yarn build.

I made these gist changes
https://gist.github.com/wickedst/a65bf76c52e812539abc2ee7c16408aa/revisions

I changed my package.json to include
"now-build": "next build",

In Ziet.co changed the Framework preset to Next.js which comes with build commands,
and pointed my Now production Root Directory to frontend.

Screen Shot 2020-04-06 at 11 35 21 AM

Hope this helps someone as i found Postlights and ziet's documentation a bit lacking...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants