Hello,
Recently stumbled across Frontity and have played with it and are considering using it for an upcoming project but have come across an issue when attempting to deploy a production build to Now (this is probably better aimed at their support guys).
Followed the steps outlined here (https://docs.frontity.org/installation-and-deploy/deploy-on-now) and when the project has been uploaded to Now it fails with the following error:
Running "build" script in "package.json"
06:57:55 PM Running "npm run build"
06:57:55 PM > xxxx@1.0.0 build /fargate/79229e35
06:57:55 PM > frontity build
06:57:56 PM mode: production
06:57:56 PM Building es5 bundle
06:58:15 PM Building module bundle
06:58:27 PM Building server bundle
06:58:44 PM TypeError: Cannot read property 'fsPath' of undefined
06:58:44 PM at Object.build (/fargate/1d2c7cfec274f2ae/.build-utils/.builder/node_modules/@frontity/now/dist/index.js:94:49)
06:58:44 PM at <anonymous>
06:58:44 PM worker exited with code 20 and signal null
06:58:47 PM done
The configs are pretty basic or untouched from the initial Frontity install:
package.json
{
"name": "xxxx",
"version": "1.0.0",
"private": true,
"description": "Frontity project",
"keywords": [
"frontity"
],
"scripts": {
"dev": "frontity dev",
"build": "frontity build",
"serve": "frontity serve"
},
"prettier": {},
"dependencies": {
"@frontity/core": "^1.2.1",
"@frontity/html2react": "^1.1.11",
"@frontity/mars-theme": "./packages/mars-theme",
"@frontity/tiny-router": "^1.0.14",
"@frontity/wp-source": "^1.3.1",
"@frontity/yoast": "^1.1.3",
"bootstrap": "^4.3.1",
"frontity": "^1.3.1",
"react-bootstrap": "^1.0.0-beta.14",
"react-select": "^3.0.8"
}
}
frontity.settings.js
const settings = {
"name": "xxxx",
"state": {
"frontity": {
"url": "xxxx",
"title": "Test Frontity Blog",
"description": "WordPress installation for Frontity development"
}
},
"packages": [
{
"name": "@frontity/mars-theme",
"state": {
"theme": {
"menu": [],
"featured": {
"showOnList": false,
"showOnPost": false
}
}
}
},
{
"name": "@frontity/wp-source",
"state": {
"source": {
"api": "xxxx",
"homepage": "/home"
}
}
},
"@frontity/yoast",
"@frontity/tiny-router",
"@frontity/html2react"
]
};
Besides the addition of some modules (Bootstrap & React Select) running the production build script locally works without issue, which is why I believe it’s probably best to post this on the Now forum.
Side note, we’re using (https://github.com/WP-API/menus-endpoints) to expose the WP menus and manually stripping out everything before the slug when it is received in Frontity. This doesn’t seem like the correct way to do this and I was hoping someone had a better solution to this.