New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brunch doesn't include my module #1250

Closed
Surfoo opened this Issue Mar 22, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@Surfoo

Surfoo commented Mar 22, 2016

Description

In my project, I have several js files, and when I modify a file, brunch detect changes, but the module is empty in my app.js. Example:

require.register("search.js", function(exports, require, module) {

});

I need to stop the watcher, and lauch it again. I don't have compilation issue in the terminal... :

$ brunch w
22 Mar 15:48:29 - info: compiled in 1.1 sec
22 Mar 15:48:30 - info: compiled 10 files and 2 cached into app.js, copied 87 in 655ms
22 Mar 15:48:56 - info: compiled search.js and 11 cached files into app.js in 104ms
^C

$ brunch w
22 Mar 15:49:07 - info: compiled in 1.1 sec
22 Mar 15:49:08 - info: compiled 10 files and 2 cached into app.js, copied 87 in 620ms

Environment

  1. Brunch: 2.5.2 but tested with 2.4.2
  2. Node: v5.9
  3. NPM: 3.7.3
  4. Operating system: Debian jessie

package.json contents

{
    "name": "morpheus-ui",
    "description": "",
    "private": true,
    "scripts": {
        "start": "brunch watch",
        "prod": "brunch build --production"
    },
    "devDependencies": {
        "brunch": "~2.5.0",
        "clean-css-brunch": "~2.0.0",
        "css-brunch": "~2.0.0",
        "javascript-brunch": "~2.0.0",
        "uglify-js-brunch": "~2.0.0"
    }
}

brunch config contents

'use strict';

exports.config = {
    "paths": {
        "watched": ["app", "src"],
        "public": "web"
    },
    "files": {
        "stylesheets": {
            "joinTo": "main.css",
        },
        "javascripts": {
            "joinTo": "app.js",
        }
    },
    "modules": {
        nameCleaner: function path(path) {
            return path.substring(path.lastIndexOf("/") + 1);
        }
    }
}
@paulmillr

This comment has been minimized.

Show comment
Hide comment
@paulmillr

paulmillr Mar 22, 2016

Member

Interested in your brunch build -d output.

Member

paulmillr commented Mar 22, 2016

Interested in your brunch build -d output.

@Surfoo

This comment has been minimized.

Show comment
Hide comment
@Surfoo

Surfoo commented Mar 22, 2016

Here the output : http://pastebin.com/s8Ev7MPD

@goshakkk

This comment has been minimized.

Show comment
Hide comment
@goshakkk

goshakkk Mar 22, 2016

Contributor

Could also be related to the race condition between the editor and the fs watcher. See this thread #1219 (comment)

Contributor

goshakkk commented Mar 22, 2016

Could also be related to the race condition between the editor and the fs watcher. See this thread #1219 (comment)

@Surfoo

This comment has been minimized.

Show comment
Hide comment
@Surfoo

Surfoo Mar 22, 2016

I don't know, but I use Sublime text 3 over sshfs. The watcher is on the server, not on my computer.

Surfoo commented Mar 22, 2016

I don't know, but I use Sublime text 3 over sshfs. The watcher is on the server, not on my computer.

@goshakkk

This comment has been minimized.

Show comment
Hide comment
@goshakkk

goshakkk Mar 23, 2016

Contributor

@Surfoo can you test whether editing it in vim for example over ssh produces that same issue?

Also with ST over sshfs, can you try adding to your config awaitWriteFinish: true (and see if it helps), or usePolling: true (and see if it helps), or both and see if it fixes it.

Contributor

goshakkk commented Mar 23, 2016

@Surfoo can you test whether editing it in vim for example over ssh produces that same issue?

Also with ST over sshfs, can you try adding to your config awaitWriteFinish: true (and see if it helps), or usePolling: true (and see if it helps), or both and see if it fixes it.

@Surfoo

This comment has been minimized.

Show comment
Hide comment
@Surfoo

Surfoo Mar 23, 2016

I added these 2 settings and also atomic_save: true in my ST config. It's maybe overkill, but I don't have the problem right now. I'll let a comment if the problem reappears in the next few days.

Thanks for your help!

Surfoo commented Mar 23, 2016

I added these 2 settings and also atomic_save: true in my ST config. It's maybe overkill, but I don't have the problem right now. I'll let a comment if the problem reappears in the next few days.

Thanks for your help!

@goshakkk

This comment has been minimized.

Show comment
Hide comment
@goshakkk

goshakkk Mar 23, 2016

Contributor

Great, please do report how that works for you :)

Contributor

goshakkk commented Mar 23, 2016

Great, please do report how that works for you :)

@goshakkk

This comment has been minimized.

Show comment
Hide comment
@goshakkk

goshakkk May 11, 2016

Contributor

Adding this to the FAQ: #1361

Contributor

goshakkk commented May 11, 2016

Adding this to the FAQ: #1361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment