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

Binary files are corrupted in dev mode #1636

Closed
Toub opened this issue Feb 15, 2016 · 1 comment · Fixed by #1780
Closed

Binary files are corrupted in dev mode #1636

Toub opened this issue Feb 15, 2016 · 1 comment · Fixed by #1780

Comments

@Toub
Copy link

Toub commented Feb 15, 2016

Binary files dynamically generated and downloaded from the api are corrupted, due to connect-livereload trying to inject code into the binary.

The issue is discussed here: intesso/connect-livereload#39

This can be fixed by configuring connect-livereload to ignore /api path in server/config/express.js:

if ('development' === env) {
        app.use(require('connect-livereload')({
            ignore: [/^\/api\/(.*)/,
                /\.js(\?.*)?$/, /\.css(\?.*)?$/, /\.svg(\?.*)?$/, /\.ico(\?.*)?$/, /\.woff(\?.*)?$/,
                /\.png(\?.*)?$/, /\.jpg(\?.*)?$/, /\.jpeg(\?.*)?$/, /\.gif(\?.*)?$/, /\.pdf(\?.*)?$/
              ]
        }));
    }

To reproduce, simply download a binary from the api using res.download.

jackkum added a commit to jackkum/generator-angular-fullstack that referenced this issue Apr 11, 2016
I spent a whole day to find the problem.
@jchukwum
Copy link

@Toub,

This was quite helpful. Thank you so much.

John

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