Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Conversation

ianand
Copy link
Contributor

@ianand ianand commented Feb 18, 2021

No description provided.

@juanmaguitar
Copy link
Member

juanmaguitar commented Feb 22, 2021

Hi @ianand

First of all, thanks a lot for the detailed instructions about how to deploy a Frontity project on Moovweb XDN 😊

I've followed the process explained in this guide and I've found 2 issues in the process

xdn init is not detecting the Frontity project

As per the instructions, I guess the command xdn init should detect the Frontity project and do automatically 2 things:

  • Install the proper Frontiity connector as a dev dependency → "@xdn/frontity"
  • Add the proper connector in xdn.config.js
module.exports = {
  connector: "@xdn/frontity",
};

xdn init is not doing this automatically (in the tests I've done) so these extra steps should be added to the guide in order the next step to work (xdn dev fro example)

xdn deploy throws an error

The log shows a message saying Add "origin" to the "backends" property in xdn.config.js. so maybe an extra step should be added to the guide to work properly

(base) ⬢  demo-moovweb-deploy  xdn deploy
🔑 Logged in as juanma.garrido@gmail.com.

fatal: not a git repository (or any of the parent directories): .git

You have uncommitted changes. No commit URL will be stored in moovweb.app.

📋 Deploying to:
> team=Private space
> site=demo-moovweb-deploy
> environment=default
> xdn-version=2.46.3

⌛ Initializing...
> Deployment #1
> Since this is the first deployment to the default environment, it will take longer than subsequent deployments.
done (25191ms)

🛠️  Building your app for deployment on the MOOVWEB XDN

  - mode: production
  - target: both
  - public-path: /static/

Building es5 bundle
Building module bundle
Building server bundle

> sw/service-worker.js not found... skipping.
> Bundling routes.js and xdn.config.js... done.

***** Deployment Failed *********************************************************
*                                                                               *
*  🖥  View the build log in XDN Developer Console:                              *
*  https://moovweb.app/juanma-garrido/demo-moovweb-deploy/env/default/builds/1  *
*                                                                               *
*  Need help? Try posting in the XDN Developer Forums:                          *
*  https://forum.moovweb.com                                                    *
*                                                                               *
*  Or browse the XDN Documentation:                                             *
*  https://developer.moovweb.com                                                *
*                                                                               *
*********************************************************************************


Project build failed

Error:
Errors occurred while attempting to deploy your application to the XDN edge.
The following route could not be processed:
* fallback: Error: Add "origin" to the "backends" property in xdn.config.js.
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:19897
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:18446
    at Object.next (/Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:18551)
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:17463
    at new Promise (<anonymous>)
    at o (/Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:17208)
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:19622
    at Array.map (<anonymous>)
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:19598
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:18446
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:21712
    at /Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:18446
    at Object.next (/Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:18551)
    at i (/Users/juanma/PROJECTS/2021/FRONTITY/DEMOS/FEBRUARY/demo-moovweb-deploy/.xdn/lambda/routes.js:2:17265)

I guess you'll know better than anyone how to solve these issues but let me know if there's something we can do to help from the Frontity side

@juanmaguitar juanmaguitar self-requested a review February 22, 2021 16:50
Copy link
Member

@juanmaguitar juanmaguitar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested as per #271 (comment)

@ianand
Copy link
Contributor Author

ianand commented Feb 22, 2021

@juanmaguitar will take a look. there might have been a regression from last week.

@ianand
Copy link
Contributor Author

ianand commented Feb 22, 2021

I've reproduced the error using the same process that worked last week. Definitely a regression. Will update you when resolved.

@ianand
Copy link
Contributor Author

ianand commented Mar 1, 2021

@juanmaguitar this issue has been resolved you will need to update the XDN CLI to the latest version by re-running:

npm install -g @xdn/cli

and then the documented steps should work. Here's a transcript below but don't hesitate to ping me if you run into anything:

ishananand@Ishan-Anand temp % npx frontity create front-2021-03-01-02
npx: installed 189 in 8.886s
? Pick a starter theme to clone: @frontity/mars-theme (recommended)
✔ Creating README.md.
✔ Creating package.json.
✔ Creating frontity.settings.js.
✔ Cloning @frontity/mars-theme.
✔ Installing dependencies.
✔ Downloading favicon.ico.

Frontity project created.

? Do you want to receive framework updates by email? No

Ok, that's fine! 😉
You can subscribe at any point with npx frontity subscribe <email>.

Run cd front-2021-03-01-02 && npx frontity dev and have fun! 🎉

You can find docs at https://docs.frontity.org/.
For technical support and assistance please join our community at https://community.frontity.org/.

ishananand@Ishan-Anand temp % npm install -g @xdn/cli
/Users/ishananand/.nvm/versions/node/v12.18.4/bin/xdn -> /Users/ishananand/.nvm/versions/node/v12.18.4/lib/node_modules/@xdn/cli/index.js
+ @xdn/cli@2.46.9
updated 4 packages in 10.23s
ishananand@Ishan-Anand temp % cd front-2021-03-01-02
ishananand@Ishan-Anand front-2021-03-01-02 % xdn init
ℹ installing @xdn/core, @xdn/cli, @xdn/prefetch, @xdn/devtools, @xdn/frontity, @xdn/react...
npm WARN deprecated @hapi/joi@16.1.8: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated @hapi/formula@1.2.0: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/pinpoint@1.0.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead

> ejs@2.7.4 postinstall /Users/ishananand/code2/temp/front-2021-03-01-02/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm WARN react-helmet-async@1.0.7 requires a peer of react@^16.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-helmet-async@1.0.7 requires a peer of react-dom@^16.6.0 but none is installed. You must install peer dependencies yourself.

+ @xdn/devtools@2.46.9
+ @xdn/frontity@2.46.9
+ @xdn/cli@2.46.9
+ @xdn/core@2.46.9
+ @xdn/prefetch@2.46.9
+ @xdn/react@2.46.9
added 331 packages from 202 contributors and audited 1181 packages in 17.868s

77 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

✔ installing @xdn/core, @xdn/cli, @xdn/prefetch, @xdn/devtools, @xdn/frontity, @xdn/react... done.
> xdn.config.js not found, creating...
> sw/service-worker.js not found, creating...
> routes.js not found, creating...

Added the following scripts:

xdn - Run xdn commands using the local version of the XDN CLI.
xdn:dev - Simulate your app on the XDN locally.
xdn:build - Build your app for deployment on the XDN.
xdn:deploy - Build and deploy your app on the XDN.

🎉 Your app is now ready to deploy on the MOOVWEB XDN!

ishananand@Ishan-Anand front-2021-03-01-02 % xdn deploy
🔑 Logged in as ishan@moovweb.com.

fatal: not a git repository (or any of the parent directories): .git

You have uncommitted changes. No commit URL will be stored in moovweb.app.

📋 Deploying to:
> team=Private space
> site=front-2021-03-01-02
> environment=default
> xdn-version=2.46.9

⌛ Initializing...
> Deployment #1
> Since this is the first deployment to the default environment, it will take longer than subsequent deployments.
done (23240ms)

🛠️  Building your app for deployment on the MOOVWEB XDN

  - mode: production
  - target: both
  - public-path: /static/

Building es5 bundle
Building module bundle
Building server bundle

> Building service worker...
> Bundling routes.js and xdn.config.js... done.
> Writing static asset manifest... done.
done (33582ms)

📦 Packaging...
> Zipping project folder
> Size: 1.24 MB
done (196ms)

📡️ Uploading...
> Uploading package
done (7957ms)

⌛ Deploying...
> Verifying that the deployment has reached your nearest global POP...
done (65079ms)

***** Deployment Complete ****************************************************
*                                                                            *
*  🖥  XDN Developer Console:                                                 *
*  https://moovweb.app/ishan-anand/front-2021-03-01-02/env/default/builds/1  *
*                                                                            *
*  🌎 Website:                                                               *
*  https://ishan-anand-front-2021-03-01-02-default.moovweb-edge.io           *
*                                                                            *
******************************************************************************

ishananand@Ishan-Anand front-2021-03-01-02 % 

@juanmaguitar juanmaguitar self-requested a review March 2, 2021 10:57
@juanmaguitar juanmaguitar merged commit 6ead7ac into frontity:master Mar 2, 2021
@juanmaguitar
Copy link
Member

@ianand I works great!
PR approved and merged
How to deploy to Moovweb XDN is now part of our official docs! 🎉
Thanks for your contribution

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

Successfully merging this pull request may close these issues.

2 participants