deploying sage 11 theme using npm run build

Continuing the discussion from I don't know how to use Sage 11:

does this work when you do npm run build? I get this error when activating the theme/accessing the site and for the life of me, i cant figure out why.

// the boilerplate that composer create-project roots/sage provides
export default defineConfig({
base: ‘/wp-content/themes/[theme_name]/public/build/’,//‘/app/themes/sage/public/build/’,
plugins: [
tailwindcss(),
laravel({
input: [
‘resources/css/app.css’,
‘resources/js/app.js’,
‘resources/css/editor.css’,
‘resources/js/editor.js’,
],
refresh: true,
}),

wordpressPlugin(),

// Generate the theme.json file in the public/build/assets directory
// based on the Tailwind config and the theme.json file from base theme folder
wordpressThemeJson({
  disableTailwindColors: false,
  disableTailwindFonts: false,
  disableTailwindFontSizes: false,
}),

],
resolve: {
alias: {
// has at symbol
‘scripts’: ‘/resources/js’,
‘styles’: ‘/resources/css’,
‘fonts’: ‘/resources/fonts’,
‘images’: ‘/resources/images’,
},
},
})

When I do npm run dev, the homepage loads and i can do development just fine but my concern is that when i need to deploy it on a wordpress hosted site, it will give this same error.

I do see that it is trying to look for a manifest.json file under public when the manifest.json is under build. I had already tried updating the base to …/public/ and rebuild but it still generates the same file structure in build and the exact same content in manifest.json and all the other files in assets. The docs doesnt provide much information and most examples i see uses v10 with bud.config.js. Any ideas?

At a glance, it looks like you’re not on PHP 8.2+ so Composer is downloading an old version of Acorn.

PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies

What does wp acorn about return?

Wordpress version: Version 6.8.1

I’m looking at this page: Installing Acorn | Acorn Docs | Roots, the server requirements.

Aha. I think it’s due to a bug from having build in your theme name: 🩹 fix: allow 'build' to be part of theme or project name by tombroucke · Pull Request #470 · roots/acorn · GitHub

It’s been fixed but still needs a release. I can get one out Monday.

In the mean time, you should be able to try the fix with composer require roots/acorn:dev-main

Thank you! that was the issue. :person_facepalming:, I never did thought of creating it with another project name.