Library for cross-platform mapping of MIME types to file extensions and vice versa

TL;DR: The question is: Do you know of a cross-platform library that I can use from C++ to map MIME type(s) <-> file extension(s)? My application is supposed to handle image and video files...

Type Error: expected string or bytes-like object

I keep getting the 'expected string or bytes-like object ' error and i don't know why. Can anybody help? Thanks! VIEW data = request.POST.get('data') data_an = time.strptime(request.POST['data'],...

`regeneratorRuntime` is not defined when running Jest test

The title pretty much explains what I'm facing. I'm trying to test a React component that has some state, and I attempt to provide my store to the component in order to get what it needs. When I...

React-Bootstrap with Webpack not working from react-starter-kit

Please I need some help as I'm having a hard time trying to use bootstrap and react-bootstrap in my new project created from a react-starter-kit template...

Jest error Unexpected token ... (ES6)

I am getting the following error whenever I run jest in commandline: ● Test suite failed to run /Users/<USER>/<Project>/src/login/LoginAPI.js:13 ...headers, ^^^ SyntaxError:...

How to write lossless WebP files with PerlMagick

I'm trying to convert PNG files to lossless WebP in Perl with Graphics::Magick. Command line for that is: $ gm convert in.png -define webp:lossless=true out.webp My Perl code looks something...

Using Sharp & Express causes exception : "Input buffer contains unsupported image format"

I'm using Node & Express & Sharp to: Download an image as stream -> convert to webp -> response the user with the converted image This code does the job : import express from 'express'; import...

Serve different assets depending Modernizr

I'm setting up a new node.js server, and I want to send to the user different web pages/assets depending on the response of the Modernizr library. This is a Windows server, it uses express basic...

Wordpress and PHP 5.5 - WebP conversion for all images?

Good day. I need to optimize the images in the website, converting PNG/JPEG to webP format. I tried several plugins like : Kraken, Shortpixel, Optimus, EWWW Optimizer, WP Smush, Imagify, WebP...

How to fix 'bundle.js 404 (not found)' after deploying to Heroku w/ an Express/Webpack/React app?

In my console for my app I get GET ...herokuapp.com/bundle.js 404 (Not Found) Not sure what's wrong. This works fine on localhost. Can anyone help? :( (This isn't built with the...

Different Set-Cookie header in fetch response from react-native app in ios and android

It's strange, but I don't see some set-cookie headers from my express server in react-native app only on android devices! I use express on my node.js server const express =...

// @flow: Uncaught ReferenceError: number is not defined

I just copied an example from the official flow website: // @flow function doSomething<T>(param: T): T { // ... return param; } doSomething<number>(3); And getting the error: Uncaught...

axios request get connect EHOSTUNREACH Error. response header got default-src 'self'

Hey I'm working on SSR app with express. when the request hits, render server(running on localhost:3000) send request to api server(running on localhost:3001) for initial user's session store. but...

How to read DraftJS state from localStorage?

I have an issue with reading Draft.js raw content from localStorage. I would like to use previously stored rawContent as my initialState for the reducer. I think convertFromRaw function is my...

Internal Error 500 at POST request Express JS and Formidable

I want to send form data (multipart) to my express js server. I learned I could use multer or formidable. Formidable seemed easy to understand for me So I went with it, but I am having issue I...

How to (varnish) cache webp images based on accept header

TLDR; I'm upgrading my clients outdated server but I'm having trouble getting webp images cached (or not) based on the browser accept header. Varnish caches webp image until somebody with an old...

ng serve localhost:4200 when opened it downloads an empty file

when I ng serve my Angular project and then open localhost:4200, there is no redirection, instead it is just downloading a file called 'download' whose file type is 'file'. I dont really get...

Cross domain state cookie issue for oAuth using firebase functions while on the same domain

I am implementing a oAuth login for a user for the firebase platform. All works fine except if the user has disabled cross domain cookies. Here is what I did. From my domain/app the user gets...

Why is my req.user not getting saved on older versions of Chrome?

I'm using passportjs and express to handle my authentication. I had a few users running older (but not really that old) versions of chrome not being able to login. I ran some tests, I'm using...

ERROR in ./node_modules/imagemagick/imagemagick.js Module not found: Error: Can't resolve 'child_process'

I'm trying to start an application built with react boilerplate and cordova and after doing npm install the application it breaks in this point: Building the Webpack DLL... Hash:...

Send GraphQLUpload to imagekit.io from node server running express-graphql

Inexperienced dev here. This issue is driving me crazy. I am sending an image file from a react front end via a graphQL mutation to a node server running express-graphql. The uploadFile mutation...

Why am I getting handshake failure Apollo client error (with EPROTO errno)?

I'm using apollo-boost: ^0.4.3 with next.js. I recently added cookie authentication to my website. The biggest change was adding headers and credentials: 'include' to ApolloClient constructor. In...

Chrome re-downloading same images each time in same session

I'm new to React and I'm trying to serve some files from either my public folder or any remote URL. No matter where I request the images from, my browser always re-downloads same images over and...

Azure Active Directory ASP.NET Core 3.1 "We couldn't sign you in. Please try again." Are we missing any configurations?

We are using .NET core 3.1, Azure AD , and Visual Studio Connected Services templates which attempt to generate the startup.cs file. Are we not setting something in the config? We are not using...

JWT is not working as expected with Node.JS

I am having a hard time to get things to work as they are supposed to with JWT on Node JS. Let me first say that my goal is (after logging in) to access the privateRoute route of my API. I am...

deploy nextjs app on firebase google cloud

I am thinking of deploying nextjs project on gcp firebase. However, I could not see any pages running. I mean it's shown fully blank. I am not quite sure if I missed something for deployment. Here...

Webpack prod build stuck at 96% chunk asset optimization TerserPlugin

I am seeing this issue 100% of the attempts at building webpack for production. I've tried the approach mentioned on the other similar StackOverflow issues which is...

Unable to import image in react app "Invalid or unexpected token"

The issue is I get the error below when I run my node/react app. I had no issues importing images like this with create react app, but I want to do server side rendering so I followed a course on...

504 Gateway Time-out error Keycloak with Microsoft SSO

I am running a Node App that uses Keycloak for authentication. I added Microsoft as my Identity Provider. The authentication flow works sometimes, but sometimes it also gives me a 504 Gateway...

Request to mediamarkt.es always returns 403

So I'm trying to scrape mediamarkt.es with this code: PORT = 8000; const express = require("express"); const axios = require("axios").default; const cors = require("cors")({ origin: true...