Skip to content
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

Missing manifest file on first run #9

Closed
youngbrioche opened this issue Nov 8, 2017 · 3 comments
Closed

Missing manifest file on first run #9

youngbrioche opened this issue Nov 8, 2017 · 3 comments

Comments

@youngbrioche
Copy link

youngbrioche commented Nov 8, 2017

When using the following config faucet throws

$ faucet --no-fingerprint --watch
monitoring file system at /Users/rglaser/workspace/innoq/innoq.com-cms/app/assets
Generated an empty bundle
{ Error: ENOENT: no such file or directory, open '/Users/rglaser/workspace/innoq/innoq.com-cms/public/assets/manifests/static.json'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/rglaser/workspace/innoq/innoq.com-cms/public/assets/manifests/static.json' }

Every consecutive run after that won't emit this warning.

faucet.config.js:

const sassConfig = {
    manifest: {
        file: "public/assets/manifests/stylesheet.json",
        baseURI: (bundlePath, baseName) => `/assets/stylesheets/${baseName}`
    },
    assets: [
        "public/assets/manifests/static.json"
    ],
    prefixes: {
        browsers: [ "last 2 versions" ]
    },
    bundles: [{
        entryPoint: "app/assets/stylesheets/frontend/application.scss",
        target: "public/assets/stylesheets/frontend/application.css"
    }]
};

const staticConfig = {
    manifest: {
        file: "public/assets/manifests/static.json",
        baseURI: (bundlePath, baseName) => `/assets/static/${baseName}`
    },
    bundles: [{
        source: "app/assets/images",
        target: "public/assets/static"
    }]
}

module.exports = {
    sass: sassConfig,
    static: staticConfig
}
@youngbrioche
Copy link
Author

yarn run compile && yarn run compile

helps.

@youngbrioche
Copy link
Author

youngbrioche commented Nov 10, 2017

Possibly related: faucet-pipeline-sass crashes while watching with every edit of a random scss file with:

undefined:1



SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at fs.readFile (/Users/rglaser/workspace/innoq/innoq.com-cms/node_modules/faucet-pipeline-sass/lib/build-asset-map-reader.js:22:18)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
error Command failed with exit code 1.

Looks like a race condition between faucet-pipeline-sass and faucet-pipeline-static. Maybe the given manifest is not yet ready and faucet-pipeline-sass already starts parsing it?

@moonglum
Copy link
Member

This is done now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants