# Sage 10 - Bud doesn't start the dev server when using a plugin

**URL:** https://discourse.roots.io/t/sage-10-bud-doesnt-start-the-dev-server-when-using-a-plugin/22132
**Category:** bud
**Tags:** sage10
**Created:** 2022-01-19T13:27:57Z
**Posts:** 10

## Post 1 by @erip2 — 2022-01-19T13:27:57Z

When using the ‘svg-spritemap-webpack-plugin’ plugin on bud, the local server of localhost:3000 doesn’t start and it only says: Sorry can’t find that!

It works fine if I remove the plugin. This is the bud config of the plugin:

```
const SVGSpritemapPlugin = require('svg-spritemap-webpack-plugin');

module.exports = async (config) =>
  config
    .use(new SVGSpritemapPlugin('resources/sprite/*.svg', {
      output: {
        filename: 'spritesheet.svg',
        chunk: { keep: true },
        svgo: false,
      },
    }))
```

---

## Post 2 by @ben — 2022-01-19T21:54:06Z

:eyes: Hey there! Mind getting a bug report opened on the Bud repo?

---

## Post 3 by @kellymears — 2022-01-20T06:44:09Z

I think this is fixed in bud 5.1.0. I just tested it and it does not cause any errors in the terminal or browser.

---

## Post 4 by @erip2 — 2022-01-20T08:49:32Z

I did upgrade with `yarn upgrade @roots/bud` but now when I run `yarn dev` it just returns

```
TypeError: Cannot read properties of undefined (reading 'store')
```

on the terminal.

---

## Post 5 by @kellymears — 2022-01-20T10:12:39Z

you should open an issue in the bud repo.

for now, without much else to go on, you should:

- run `yarn bud install` to update your `package.json` dependencies
- run `yarn install` to install them

you can see the expected dependencies in the current `main` branch of `roots/sage`, for reference.

> <https://github.com/roots/sage/blob/f63033ef3ae9312ea27d07d3be075cbd0ccff8ff/package.json#L25-L42>

not sure if you read [the release notes for bud v5.1.0](https://discourse.roots.io/t/bud-v5-1-0-released/) but there is a change that needs to be made to the `bud.assets()` call in your config.

for further debugging please make an issue on github. the issue form will ask you for some files from the `.budfiles` directory of your project along with a few other critical pieces of information that will make it much easier for me to help.

---

## Post 6 by @erip2 — 2022-01-20T14:38:21Z

Ok, I opened a bug report here: [The dev server doesn't start when using a plugin · Issue #1003 · roots/bud · GitHub](https://github.com/roots/bud/issues/1003)

Thanks!

Although, after updating to the new versions of Bud and Sage, other problems have come up:

The SASS file doesn’t get compiled.  
The JS file path is incorrect, it adds localhost:3000 in the URL, it is like this:  
[http://mysite-sage.test/app/themes/mysite-sage/public/http://localhost:3000app.js](http://mysite-sage.test/app/themes/mysite-sage/public/http://localhost:3000app.js)

When I installed the new Sage from scratch it was shown like this:  
[http://mysite-sage.test/app/themes/mysite-sage/public/undefinedapp.js](http://mysite-sage.test/app/themes/mysite-sage/public/undefinedapp.js)

Maybe I should open a new issue here at discourse about these?

---

## Post 7 by @kellymears — 2022-01-20T19:33:48Z

> [@erip2](#):
>
> The SASS file doesn’t get compiled.

i’ll have to look into this.

> [@erip2](#):
>
> The JS file path is incorrect, it adds localhost:3000 in the URL, it is like this:  
> [http://mysite-sage.test/app/themes/mysite-sage/public/http://localhost:3000app.js](http://mysite-sage.test/app/themes/mysite-sage/public/http://localhost:3000app.js)

you need to update acorn in `composer.json`. snag the current version from roots/sage repo’s `composer.json`.

> [@erip2](#):
>
> When I installed the new Sage from scratch it was shown like this:  
> [http://mysite-sage.test/app/themes/mysite-sage/public/undefinedapp.js](http://mysite-sage.test/app/themes/mysite-sage/public/undefinedapp.js)

you aren’t setting a publicPath in `bud.config.js`, which is required in order for sage to work properly in development mode.

based on my interpretation of your filepath, it’s probably:

```
bud.setPublicPath('/app/themes/galia-sage/')
```

the relevant output in `webpack.config.js`:

```
"output": Object {
    ...,
    "publicPath": "",
  },
```

that string shouldn’t be empty.

---

## Post 8 by @erip2 — 2022-01-20T22:10:09Z

Thanks for the information. It worked, also with the reply I had in the repo.

The only thing that doesn’t totally work is the SASS compilation. When I’m running `yarn dev` it updates the CSS, but only as `<style></style>` not as app.css, while when running `yarn build` it works as expected.

---

## Post 9 by @kellymears — 2022-01-21T01:25:47Z

in order for hot reload to work styles are applied by js in development. there is no css file generated. when you update your source files the style tag is updated directly in the DOM.

---

## Post 10 by @erip2 — 2022-01-21T08:10:00Z

Ah, I see, thanks :smiley:

So, for anyone else that came here for the issue title, the solution is here: [The dev server doesn't start when using a plugin · Issue #1003 · roots/bud · GitHub](https://github.com/roots/bud/issues/1003#issuecomment-1017950712) but I’m sure this will get fixed in a future release.

Marking this as solved.
