Using the latest Sage10 (i updated from a lower version, with no major changes).
I am getting the following error when running npm run dev (after around ~1 minute):
/var/www/webserver/cs-thyme/wp-content/themes/cs-thyme/node_modules/load-json-file/node_modules/parse-json/index.js:31
throw jsonErr;
^
ErrorEXError [JSONError]: Unexpected end of JSON input while parsing near '' in package.json
When running i also get - which may be in correlation to the error:
$ bud dev
[sage] › ✖ `import sass from 'sass'` is deprecated.
Please use `import * as sass from 'sass'` instead.
This is my package.json:
{
"name": "sage",
"packageManager": "yarn@3.3.1",
"private": true,
"type": "module",
"browserslist": [
"extends @roots/browserslist-config"
],
"engines": {
"node": ">=16.0.0"
},
"volta": {
"node": "16.20.2",
"yarn": "1.22.19",
"npm": "8.19.2"
},
"scripts": {
"dev": "bud dev",
"build": "bud build",
"clean": "bud clean",
"translate": "yarn translate:pot && yarn translate:update",
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
"translate:update": "for filename in ./resources/lang/*.po; do msgmerge -U $filename ./resources/lang/sage.pot; done; rm -f ./resources/lang/*.po~",
"translate:compile": "yarn translate:mo && yarn translate:js",
"translate:js": "wp i18n make-json ./resources/lang --pretty-print",
"translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
},
"devDependencies": {
"@roots/bud": "6.12.2",
"@roots/bud-sass": "6.12.2",
"@roots/sage": "6.12.2"
},
"dependencies": {
"reset-css": "^5.0.1"
}
}
bud.config.mjs:
// @ts-check
/**
* Compiler configuration
*
* @see {@link https://roots.io/docs/sage sage documentation}
* @see {@link https://bud.js.org/guides/configure bud.js configuration guide}
*
* @param {import('@roots/bud').Bud} app
*/
export default async (app) => {
app
/**
* Application entrypoints
*
* @see {@link https://bud.js.org/docs/bud.entry}
*/
.entry({
app: ["@scripts/app", "@styles/app"],
editor: ["@scripts/editor", "@styles/editor"],
})
/**
* Directory contents to be included in the compilation
*
* @see {@link https://bud.js.org/docs/bud.assets}
*/
.assets(["images"])
/**
* Copy `fonts` directory to `public`
*/
.copyDir(["fonts"])
/**
* Matched files trigger a page reload when modified
*/
.watch(["resources/views/**/*", "app/**/*"])
/**
* Proxy origin (`WP_HOME`)
*/
.proxy("http://localhost/")
/**
* Development origin
*/
.serve("http://localhost:3000")
/**
* URI of the `public` directory
*
* @see {@link https://bud.js.org/docs/bud.setPublicPath}
*/
.setPublicPath("/wp-content/themes/sage/public/")
/**
* Generate WordPress `theme.json`
*
* @note This overwrites `theme.json` on every build.
*/
// i didn't change this to the new set() function - i don't think this should have an impact
.wpjson.settings(.......)
.enable()
};