# Script bug in "yarn build", but work fine in "yarn start", why?

**URL:** https://discourse.roots.io/t/script-bug-in-yarn-build-but-work-fine-in-yarn-start-why/14887
**Category:** sage
**Tags:** webpack
**Created:** 2019-02-21T10:53:51Z
**Posts:** 2

## Post 1 by @Jimmylet — 2019-02-21T10:53:51Z

Hello,

I tear off my head on a bug that I do not understand.

I made all my development in “yarn watch”. And now that I’m coming to the end, I’m doing a “yarn build” or “yarn build: production” and it’s not working as expected.

One of my scripts does not work as expected (it works oddly), but when I’m in “yarn start”, it works perfectly.

I tried to get it out of my javascript compilations, to have it clear in the page, but it’s the same problem. It works in “start”, but not in “build”.

I do not have an error message in the console.

What is this?

Can you help me ?

Thank you

---

## Post 2 by @mmirus — 2019-02-21T15:10:21Z

Hey @Jimmylet,

Sorry to hear you’re having trouble! Can you provide more detail? Without additional info, we can’t help troubleshoot. For example:

- What’s the script? Can you share the code?
- How is it behaving oddly?
- Have you checked both the JS console in your browser and the shell where you’re running `yarn build` for relevant messages?
