Fresh Install - ModuleNotFoundError: Module not found: Error: Can't resolve '@scripts/editor'

Fresh install of Sage Roots 10 and first time using it, having used Sage 8 and 9 plenty over the last few years.

I’m trying to set up support for SCSS and have installed bud-postcss and bud-sass (versions 6.3.1) and have updated by bud.js to the same version, but on running yarn build I’m getting an error that

ModuleNotFoundError: Module not found: Error: Can't resolve '@scripts/editor.js'

Those files obviously exist and I could build prior to install the new packages and the update. Am I missing something with the update process?

Dependancies in package.json:

"devDependencies": {
    "@roots/bud": "^6.3.1",
    "@roots/bud-postcss": "^6.3.1",
    "@roots/bud-sass": "^6.3.1",
    "@roots/sage": "5.8.7"
  }

bud.config.js:

/**
 * @typedef {import('@roots/bud').Bud} bud
 *
 * @param {bud} app
 */
module.exports = async (app) => {
  app
    /**
     * Application entrypoints
     *
     * Paths are relative to your resources directory
     */
    .entry({
      app: ['@scripts/app', '@styles/app'],
      editor: ['@scripts/editor', '@styles/editor'],
    })

    /**
     * These files should be processed as part of the build
     * even if they are not explicitly imported in application assets.
     */
    .assets('images')

    /**
     * These files will trigger a full page reload
     * when modified.
     */
    .watch('resources/views/**/*', 'app/**/*')

    /**
     * Target URL to be proxied by the dev server.
     *
     * This should be the URL you use to visit your local development server.
     */
    .proxy('http://localhost')

    /**
     * Development URL to be used in the browser.
     */
    .serve('http://0.0.0.0:3000');
};

I also ran yarn bud doctor to check on things:

Checking configuration...

✅ production configuration is valid
✅ development configuration is valid


Checking dependencies...

version mismatch
@roots/bud is not running on the same version as bud core.
bud is on 6.3.1 but @roots/bud is on ^6.3.1.

version mismatch
@roots/bud-postcss is not running on the same version as bud core.
bud is on 6.3.1 but @roots/bud-postcss is on ^6.3.1.

version mismatch
@roots/bud-sass is not running on the same version as bud core.
bud is on 6.3.1 but @roots/bud-sass is on ^6.3.1.

version mismatch
@roots/sage is not running on the same version as bud core.
bud is on 6.3.1 but @roots/sage is on 5.8.7.

Howdy! It looks like you’re using a Bud 5.x config but trying to use Bud 6.x.

Upgrading from Bud 5.x to Bud 6.x requires more than just bumping the Bud dependencies.

Have you taken a look at the upgrade guide/release notes, or referenced the Sage repo to see additional changes that you’re required to make?

1 Like

Thanks a lot Ben, I updated the theme and made the amends to get it working. :+1:t2: