Code Monkey home page Code Monkey logo

fly's Introduction

Fly.io

Fly is a hosting platform for running app servers close to users.

 # Ship a Docker image
 flyctl deploy

 # Launch it in multiple regions
 flyctl regions add ams hkg sjc

Where to go

  • flyctl
    The command line interface for deploying and managing Fly hosted applications.
  • Speedrun
    A really quick start, deploy a Docker image to Fly with just a few commands.
  • Documentation
    Reference documentation for the Fly platform, configuration options, etc.
  • Fly JS (deprecated)
    The Fly JavaScript runtime for building edge apps.

Write for Fly

We are building a library of example projects, articles, and technical explainers. We'll pay you to help, just head on over to the project board and see what's going on.

We're looking for two things:

  1. Example applications that demonstrate how to build server applications that run close to users.
  2. Articles about the plumbing underneath modern infrastructure

Example Apps

The best example apps demonstrate interesting problems developers can solve by running apps close to users. These apps should be small in scope and single purpose. They're not meant to be run directly, they're demonstrations of ideas that developers can apply to their own projects.

Explainer Articles

It is helpful for developers to understand the plumbing underneath their infrastructure. Technical explainers help with this, and should cover some part of internet/hosting infrastructure.

fly's People

Contributors

mrkurt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fly's Issues

Less globals, more require/import on v8env

The fly. global is sorta gross, it'd be much nicer to:

import { Image } from 'fly/image'

The tricky part of this is that we build our base v8 context with webpack, and then build an app with webpack separately. So the app level webpack needs to understand how to import/require from that base webpack (or we need to do proper module loading).

Inflate content-encoded bodies on read

Right now, we have to request uncompressed responses with fetch if we want to do anything useful with the response body. This is a bit overkill when you only want to do things on some bodies. It'd be nice if await resp.body() just gave us un-encoded content, possibly with an option to fetch.

Fix and re-enable the DOM "module"

Also used to work, removed it at some point as we thought it was causing crashes.

Interacting with a DOM is much easier than manipulating raw strings of HTML.

Allow easily manage log levels

Currently the server dumps a lot of stuff by default and it's too verbose. It also causes our console.log to get buried.

  1. Please reduce the amount of output at least in developer mode
  2. If I do console.log("bla"), I should be able to see only see bla but it shows 2018-06-26T17:30:30.417Z - info: ::1 bla and kind of gets buried in other logs
  3. Add the debug options to the CLI's help so people can find it

tls client certificate support for fetch

We should be able to give fetch a client certificate when it's called. While we're at it, we may want to expose more tls options (for validating server certificates and whatnot).

This might need #5 to work first.

Add example apps

We don't have many example apps in this repo, we should!

Some interesting ones:

  • HTTP caching demo: use fetch and the Web Cache API (add/put/match) to do basic HTTP caching
  • HTML parsing/modification demo using fetch and the Document.parse interface to modify HTML.
  • Image resizing demo using the fly.Image API to scale images down or convert them to webp
  • Watermark demo for #55

Environments are janky

Deploys are always "production", it's not currently possible to deploy and app + settings as a "staging" environment. This might just be a documentation issue, but it's not clear how people are supposed to use environments.

Server returns response, not file

The following code will return the contents of index.html for everything.

fly.http.respondWith(async (req) => {
  const res = await fetch("file://index.html")
  res.headers.set("content-type", "text/html")
  return res
})

This is a problem because if index.html references a resource file like image.png, the contents of image.png will be the contents of index.html.

Possible Solution

All file url paths that are in .fly.yml should be overwritten and only return that file unless otherwise specified.

Current Workaround

This code works properly:

fly.http.respondWith(async (req) => {
  const url = new URL(req.url)
  const res = await fetch("file:/" + url.pathname)
  res.headers.set("content-type", "text/html")
  return res
})

Reproducible here: https://github.com/pudility/fly-error

Gracefully handle invalid fly.yml files

The dev server will crash if .fly.yml gets saved with incomplete edits, such as switching away from the editor to look at docs. Maybe instead we print an error to the console and serve a default error page. Bonus points if the error page renders the error message too.

Segmentation fault when using fly server (node version >=10.4)

Just using the example code from the docs.

Generating Webpack config...
Compiling app w/ options: { watch: true, uglify: false }
new runtime, app: /Users/nick.potts/Documents/worker-performance-examples/time 
PID 4992 received SIGSEGV for address: 0x73
0   segfault-handler.node               0x00000001083603e8 _ZL16segfault_handleriP9__siginfoPv + 312
1   libsystem_platform.dylib            0x00007fff5ae17f5a _sigtramp + 26
2   ???                                 0x00007ffeefbfd130 0x0 + 140732920746288
Segmentation fault: 11

Issue Building Fly

I am having some trouble building fly. When I run npm run build I get the error:

ERROR in ./v8env/ts/body_mixin.ts
[v8env] [tsl] ERROR in /Users/zoe/Developer/fly/v8env/ts/body_mixin.ts(99,19)
[v8env]       TS2554: Expected 0 arguments, but got 1.
[v8env]
[v8env] ERROR in ./v8env/ts/body_mixin.ts
[v8env] [tsl] ERROR in /Users/zoe/Developer/fly/v8env/ts/body_mixin.ts(104,19)
[v8env]       TS2554: Expected 0 arguments, but got 1.
[v8env]
[v8env] ERROR in ./v8env/ts/blob.ts
[v8env] [tsl] ERROR in /Users/zoe/Developer/fly/v8env/ts/blob.ts(21,21)
[v8env]       TS2554: Expected 0 arguments, but got 1.
Full Error
> @fly/[email protected] build /Users/zoe/Developer/fly
> concurrently -n "core,v8env" "npm run build:core" "npm run build:v8env"

[core]
[core] > @fly/[email protected] build:core /Users/zoe/Developer/fly
[core] > tsc
[core]
[v8env]
[v8env] > @fly/[email protected] build:v8env /Users/zoe/Developer/fly
[v8env] > webpack --config webpack.v8.config.js
[v8env]
[core] src/cmd/root.ts(31,22): error TS2339: Property 'access_token' does not exist on type 'object'.
[core] src/utils/local.ts(89,7): error TS2322: Type 'object | undefined' is not assignable to type '{}'.
[core]   Type 'undefined' is not assignable to type '{}'.
[core] npm ERR! code ELIFECYCLE
npm ERR! errno 2
[core] npm ERR! @fly/[email protected] build:core: `tsc`
[core] npm ERR! Exit status 2
[core] npm ERR!
[core] npm ERR! Failed at the @fly/[email protected] build:core script.
[core] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[core]
[core] npm ERR! A complete log of this run can be found in:
[core] npm ERR!     /Users/zoe/.npm/_logs/2018-04-05T00_55_05_614Z-debug.log
[core] npm run build:core exited with code 2
[v8env] Hash: ba3db59152d215e15cba5126411c3ddaf80d4c36
[v8env] Version: webpack 3.11.0
[v8env] Time: 4821ms
[v8env]                     Asset       Size  Chunks                    Chunk Names
[v8env]                  v8env.js    1.49 MB       0  [emitted]  [big]  main
[v8env]            v8env.map.json    1.71 MB       0  [emitted]  [big]  main
[v8env]       v8env/lib/blob.d.ts  383 bytes          [emitted]
[v8env] v8env/lib/body_mixin.d.ts  509 bytes          [emitted]
[v8env]  v8env/lib/form_data.d.ts  515 bytes          [emitted]
[v8env]     v8env/lib/logger.d.ts  183 bytes          [emitted]
[v8env]  v8env/lib/fly/image.d.ts    3.44 kB          [emitted]
[v8env]    [0] (webpack)/buildin/global.js 509 bytes {0} [built]
[v8env]   [42] ./v8env/index.js 3.79 kB {0} [built]
[v8env]   [86] ./v8env/ts/body_mixin.ts 4.15 kB {0} [built] [2 errors]
[v8env]   [87] ./v8env/ts/blob.ts 2.21 kB {0} [built] [1 error]
[v8env]   [88] ./v8env/ts/form_data.ts 1.89 kB {0} [built]
[v8env]   [89] ./v8env/response.js 2.29 kB {0} [built]
[v8env]   [91] ./v8env/cache.js 2.53 kB {0} [built]
[v8env]   [93] ./v8env/timers.js 752 bytes {0} [built]
[v8env]   [94] ./v8env/document.js 2.87 kB {0} [built]
[v8env]  [127] ./v8env/middleware/fly-backend.js 448 bytes {0} [built]
[v8env]  [128] ./v8env/middleware/fly-echo.js 751 bytes {0} [built]
[v8env]  [129] ./v8env/middleware/fly-routes.js 2.78 kB {0} [built]
[v8env]  [130] ./v8env/middleware/force-ssl.js 536 bytes {0} [built]
[v8env]  [131] ./v8env/middleware/google-analytics.js 5.47 kB {0} [built]
[v8env]  [132] ./v8env/middleware/session.js 578 bytes {0} [built]
[v8env]     + 119 hidden modules
[v8env]
[v8env] ERROR in ./v8env/ts/body_mixin.ts
[v8env] [tsl] ERROR in /Users/zoe/Developer/fly/v8env/ts/body_mixin.ts(99,19)
[v8env]       TS2554: Expected 0 arguments, but got 1.
[v8env]
[v8env] ERROR in ./v8env/ts/body_mixin.ts
[v8env] [tsl] ERROR in /Users/zoe/Developer/fly/v8env/ts/body_mixin.ts(104,19)
[v8env]       TS2554: Expected 0 arguments, but got 1.
[v8env]
[v8env] ERROR in ./v8env/ts/blob.ts
[v8env] [tsl] ERROR in /Users/zoe/Developer/fly/v8env/ts/blob.ts(21,21)
[v8env]       TS2554: Expected 0 arguments, but got 1.
[v8env] npm ERR! code ELIFECYCLE
npm ERR! errno 2
[v8env] npm ERR! @fly/[email protected] build:v8env: `webpack --config webpack.v8.config.js`
[v8env] npm ERR! Exit status 2
npm ERR!
[v8env] npm ERR! Failed at the @fly/[email protected] build:v8env script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[v8env]
[v8env] npm ERR! A complete log of this run can be found in:
[v8env] npm ERR!     /Users/zoe/.npm/_logs/2018-04-05T00_55_06_503Z-debug.log
[v8env] npm run build:v8env exited with code 2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @fly/[email protected] build: `concurrently -n "core,v8env" "npm run build:core" "npm run build:v8env"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @fly/[email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zoe/.npm/_logs/2018-04-05T00_55_06_632Z-debug.log
Looks like the issue is here

Issues are from here and here

// fly/v8env/ts/body_mixin.ts (line 99 and 104)
// and fly/v8env/ts/blob.ts (line 21)
new TextEncoder("utf-8")

I would love to know why this is happening and how to fix it. Thanks.

Unhandled promise rejection somewhere in fetch

You can replicate this by fetching a bad URL (bad hostname, do it with no internet connection, etc).

2018-01-25T16:41:59.890Z - debug: (fly) gonna fetch https://cdn.rawsgit.com/superfly/fly/master/README.md {"method":"GET"}
2018-01-25T16:41:59.890Z - info: native fetch with url: https://cdn.rawsgit.com/superfly/fly/master/README.md
2018-01-25T16:41:59.891Z - debug: fetch depth:  0
2018-01-25T16:41:59.891Z - debug: (fly) dispatched nativefetch
2018-01-25T16:41:59.903Z - warn: body is object true
2018-01-25T16:41:59.906Z - error: error requesting http resource Error: getaddrinfo ENOTFOUND cdn.rawsgit.com cdn.rawsgit.com:443
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
2018-01-25T16:41:59.906Z - debug: (fly) err :( Error: getaddrinfo ENOTFOUND cdn.rawsgit.com cdn.rawsgit.com:443
2018-01-25T16:41:59.906Z - debug: (fly) err applying nativeFetch Error: getaddrinfo ENOTFOUND cdn.rawsgit.com cdn.rawsgit.com:443
(node:17189) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: getaddrinfo ENOTFOUND cdn.rawsgit.com cdn.rawsgit.com:443
(node:17189) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Websocket support

They're pretty useful!

Still need to figure out the exact API, definitely going to look up the proper spec for it. Maybe part of the fly namespace like:

fly.ws.on("connect", function(conn){
  conn.on("message", function(message){
    // echo
    conn.send(message)
  })
});

edit: Far more details below.

The reality of this is that v8 contexts (where code runs) are disposable. In development they're disposed after every request to simulate worst-case scenarios. In production they will likely stick around for a long time until you or we deploy a new version, memory usage grows too much, or you don't get enough traffic to keep your runtime alive.

There are many ways to go about this:

Each context is kept alive during the lifetime of a connection

Which is currently the case, but we'd have to change things around a bit for websocket connections I think.

Since each context would be disconnected from the other ones, it would be harder to broadcast something to all connected clients. It would most certainly have to be triggered by an external event that can be caught by other servers too.

We can technically scale to a large amount of contexts per v8 isolates, but each context uses a minimum amount of heap (it's roughly equal to the size of our global object.) People would run out of heap very quickly.

Multiple connections per context

A context could handle multiple connections concurrently. That would be a very different way of working with contexts than we currently do. Right now a context can only handle a single connection concurrently. We'd have to change the logic here, but only for the websocket protocol.

Contexts don't communicate (yet) with each other. Broadcasting would be hard. Contexts will eventually be able to communicate via shared memory (SharedArrayBuffer,) but we don't currently support this feature. Same issue than the first solution across servers.

Connections handled outside of contexts

The server keeps websocket connections outside of v8 contexts. Each context can receive and send messages via events (like the FetchEvent, but different.)

No need to communicate across contexts, bridged functions work across contexts.


There are a lot of challenges, here are some:

  • Handle server restarts, reconnecting websocket clients
  • Memory management (each connection uses some amount of memory)
  • Broadcasting across servers

I think websockets will have to wait a little bit. We can't do them properly yet. We might add a mechanism for triggering "notifications" across servers and then this feature might be more realistic.

Service Worker spec does not allow async event handlers

Hi there! I work on a similar implementation of the Service Worker spec at Cloudflare, and in looking at Fly we noticed that its FetchEvent handler behavior doesn't match the spec.

I'm not sure if Fly is aiming to be conformant with the Service Worker spec, so you should feel free to ignore this if not. In my view, though, it benefits all players in the broader "service worker ecosystem" if we all aim for conformance, because this enables developers to leverage this consistency to do more interesting things (e.g. write code that can seamlessly run on client or server depending on circumstances). Conversely, if Service Worker implementations develop a reputation for being subtly incompatible with each other, it may lead developers to become frustrated and disillusioned with the whole ecosystem.

Under the Service Workers spec, if a FetchEvent handler returns without calling respondWith(), then the request falls back to "default handling". In the case of a standard browser-side Service Worker -- which acts as a proxy -- this means the request continues on to the origin server as if no Service Worker existed. The event handler is not allowed to call respondWith() asynchronously -- once it has returned from the initial call, it has lost its chance.

From what I can tell, Fly is designed as an endpoint, not a proxy, and so it doesn't have a notion of an "origin server". So, there's seemingly no "default handling" to fall back to. But instead of returning some sort of error, it appears Fly permits the handler to call respondWith() later on, asynchronously (and if that doesn't happen, the request hangs forever). Many of Fly's examples seem to assume this ability (by using an async event handler function). These examples would not work in a standard Service Worker.

Distribute v8env with publish

Don't need to be compiling it every time we boot up fly.

Still useful to have some way to watch for changes when developing locally though.

Maybe just don't use the MemoryFS module for v8env instead save it in a dist/ folder.

App generator in CLI

Devs should be able to generate apps from the CLI and use "app templates", sort of like Rails and Express and every other CLI based app dev environment.

Something like fly new <appname> could generate the right file system layout, stub out a hello world index.js, etc.

And for templates, fly new <appname> -t prerender-react could be a little more sophisticated, including adding a package.json, running npm install, and even offer extra customization options.

NPM modules not working

Almost any module I download from NPM fails during Fly's compilation but works fine with normal node compilation.

Modules that I've tried: raven, then-request and mime.

I think the problem is with how these modules include their own modules, like raven uses require("console") which fails but if I edit it to require("./console.js"), it works.
Another error that occurs is that the default module fs isn't available.

Fly version: 0.33.1
Node version: 8.11.1

Here's the complete log (Only raven installed):

Using /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io as working directory.
Generating Webpack config...
Compiling app w/ options: { watch: true, uglify: false }
Server listening on :::3000
2018-05-25T15:29:45.677Z - info: Config watch (add: .fly.yml)
Error: Hash: 9dbeae32e43bfbe8bd27005eee4f7af3871d9087
Version: webpack 3.12.0
Time: 846ms
          Asset    Size  Chunks                    Chunk Names
      bundle.js  619 kB       0  [emitted]  [big]  main
bundle.map.json  759 kB       0  [emitted]  [big]  main
   [5] ./node_modules/raven/lib/utils.js 10.8 kB {0} [built]
   [8] /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/url/url.js 23.3 kB {0} [built]
  [14] ./node_modules/raven/vendor/json-stringify-safe.js 1.88 kB {0} [built]
  [15] ./node_modules/raven/lib/transports.js 2.76 kB {0} [built]
  [19] ./node_modules/raven/lib/parsers.js 4.56 kB {0} [built]
  [37] ./index.js 3.38 kB {0} [built]
  [38] ./node_modules/raven/index.js 274 bytes {0} [built]
  [39] ./node_modules/raven/lib/client.js 22.1 kB {0} [built]
  [41] /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/punycode/punycode.js 14.7 kB {0} [built]
  [43] /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/url/util.js 314 bytes {0} [built]
  [44] /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/querystring-es3/index.js 127 bytes {0} [built]
  [89] ./node_modules/mime/index.js 137 bytes {0} [built]
  [90] ./node_modules/mime/Mime.js 2.66 kB {0} [built]
  [91] ./node_modules/mime/types/standard.json 7.39 kB {0} [built]
  [92] ./node_modules/mime/types/other.json 24.6 kB {0} [built]
    + 78 hidden modules

ERROR in ./node_modules/raven/lib/instrumentation/instrumentor.js
Module not found: Error: Can't resolve 'console' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation'
resolve 'console' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation'
  Parsed request is a module
  using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./lib/instrumentation)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./lib/instrumentation)
    resolve as module
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules
        using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules/console)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/console doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/console.js doesn't exist
            as directory
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/console doesn't exist
      looking for modules in /Users/devangsrivastava/node_modules
        No description file found
        Field 'browser' doesn't contain a valid alias configuration
        No description file found
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/console doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/console.js doesn't exist
        as directory
          /Users/devangsrivastava/node_modules/console doesn't exist
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules]
[/Users/devangsrivastava/Desktop/node_modules]
[/Users/node_modules]
[/node_modules]
[/Users/devangsrivastava/node_modules/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/console]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/console.js]
[/Users/devangsrivastava/node_modules/console/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/console]
[/Users/devangsrivastava/node_modules/console]
[/Users/devangsrivastava/node_modules/console.js]
[/Users/devangsrivastava/node_modules/console]
 @ ./node_modules/raven/lib/instrumentation/instrumentor.js 47:4-22
 @ ./node_modules/raven/lib/client.js
 @ ./node_modules/raven/index.js
 @ ./index.js

ERROR in ./node_modules/raven/lib/utils.js
Module not found: Error: Can't resolve 'fs' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib'
resolve 'fs' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib'
  Parsed request is a module
  using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./lib)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./lib)
    resolve as module
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules
        using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules/fs)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs.js doesn't exist
            as directory
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs doesn't exist
      looking for modules in /Users/devangsrivastava/node_modules
        No description file found
        Field 'browser' doesn't contain a valid alias configuration
        No description file found
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/fs doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/fs.js doesn't exist
        as directory
          /Users/devangsrivastava/node_modules/fs doesn't exist
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules]
[/Users/devangsrivastava/Desktop/node_modules]
[/Users/node_modules]
[/node_modules]
[/Users/devangsrivastava/node_modules/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs.js]
[/Users/devangsrivastava/node_modules/fs/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs]
[/Users/devangsrivastava/node_modules/fs]
[/Users/devangsrivastava/node_modules/fs.js]
[/Users/devangsrivastava/node_modules/fs]
 @ ./node_modules/raven/lib/utils.js 3:9-22
 @ ./node_modules/raven/index.js
 @ ./index.js

ERROR in ./node_modules/raven/vendor/node-lsmod.js
Module not found: Error: Can't resolve 'fs' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/vendor'
resolve 'fs' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/vendor'
  Parsed request is a module
  using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./vendor)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./vendor)
    resolve as module
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/vendor/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules
        using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules/fs)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs.js doesn't exist
            as directory
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs doesn't exist
      looking for modules in /Users/devangsrivastava/node_modules
        No description file found
        Field 'browser' doesn't contain a valid alias configuration
        No description file found
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/fs doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/fs.js doesn't exist
        as directory
          /Users/devangsrivastava/node_modules/fs doesn't exist
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/vendor/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules]
[/Users/devangsrivastava/Desktop/node_modules]
[/Users/node_modules]
[/node_modules]
[/Users/devangsrivastava/node_modules/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs.js]
[/Users/devangsrivastava/node_modules/fs/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/fs]
[/Users/devangsrivastava/node_modules/fs]
[/Users/devangsrivastava/node_modules/fs.js]
[/Users/devangsrivastava/node_modules/fs]
 @ ./node_modules/raven/vendor/node-lsmod.js 8:9-22
 @ ./node_modules/raven/lib/utils.js
 @ ./node_modules/raven/index.js
 @ ./index.js

ERROR in ./node_modules/raven/lib/instrumentation/instrumentor.js
Module not found: Error: Can't resolve 'module' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation'
resolve 'module' in '/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation'
  Parsed request is a module
  using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./lib/instrumentation)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/package.json (relative path: ./lib/instrumentation)
    resolve as module
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules doesn't exist or is not a directory
      /Users/devangsrivastava/Desktop/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules
        using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules)
          using description file: /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/package.json (relative path: ./node_modules/module)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/module doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/module.js doesn't exist
            as directory
              /Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/module doesn't exist
      looking for modules in /Users/devangsrivastava/node_modules
        No description file found
        Field 'browser' doesn't contain a valid alias configuration
        No description file found
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/module doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          /Users/devangsrivastava/node_modules/module.js doesn't exist
        as directory
          /Users/devangsrivastava/node_modules/module doesn't exist
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/instrumentation/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/lib/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/raven/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/node_modules]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/node_modules]
[/Users/devangsrivastava/Desktop/node_modules]
[/Users/node_modules]
[/node_modules]
[/Users/devangsrivastava/node_modules/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/module]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/module.js]
[/Users/devangsrivastava/node_modules/module/package.json]
[/Users/devangsrivastava/Desktop/HyperBoost Builds/Fly + Spaces + Fly Cache PRODUCTION.io/node_modules/module]
[/Users/devangsrivastava/node_modules/module]
[/Users/devangsrivastava/node_modules/module.js]
[/Users/devangsrivastava/node_modules/module]
 @ ./node_modules/raven/lib/instrumentation/instrumentor.js 28:15-32
 @ ./node_modules/raven/lib/client.js
 @ ./node_modules/raven/index.js
 @ ./index.js
    at Watching.handler (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/src/utils/build.ts:41:16)
    at Watching._done (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:106:8)
    at compiler.emitRecords.err (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:79:19)
    at Compiler.emitRecords (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:371:38)
    at compiler.emitAssets.err (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:62:20)
    at applyPluginsAsyncSeries1.err (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:364:12)
    at next (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:361:9)
    at require.forEach.err (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/webpack/lib/Compiler.js:350:15)
    at /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/async/dist/async.js:1064:13)
    at /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/async/dist/async.js:969:16
    at /Users/devangsrivastava/.nvm/versions/node/v8.11.1/lib/node_modules/@fly/fly/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)

fly deploy should "start" the app locally before it pushes

There are a few fun ways of deploying broken apps, if we made fly deploy actually boot before it pushes it would fix a lot of that. So far we've seen:

  1. App breaks post deploy when there's a typo in the env config (production has a typo, development does not, app works with fly server but fails once pushed)
  2. Deploy before npm install: in this case, fly server fails but the deploy occasionally works.

Deployments fail on 0.34.0

This seems to be different depending on user/app, but deploys frequently crash l with errors like this:

(node:70690) UnhandledPromiseRejectionWarning: Error: socket hang up
   at createHangUpError (_http_client.js:331:15)
   at TLSSocket.socketOnEnd (_http_client.js:423:23)
   at emitNone (events.js:111:20)
   at TLSSocket.emit (events.js:208:7)
   at endReadableNT (_stream_readable.js:1064:12)
   at _combinedTickCallback (internal/process/next_tick.js:138:11)
   at process._tickCallback (internal/process/next_tick.js:180:9)
(node:70690) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:70690) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The bundles aren't exceptionally big, and after installing 0.34.0-5 it works just fine.

Error when running global install

I'm running the command

sudo npm install -g @fly/fly

And am getting the following error

../src/isolate/convert_param.h: In static member function ‘static v8::Maybe<T*> ivm::ConvertParam<v8::Maybe<T*> >::Convert(v8::Local<v8::Value>)’:
../src/isolate/convert_param.h:118:55: error: no matching function for call to ‘v8::Local<v8::Value>::As() const’
   v8::Local<v8::Object> handle = param.As<v8::Object>();

asset bundling APIs

Edge Apps are a nice place to take a bunch of assets pieces and package + cache them. This would let people do Gatsby like rendering: first page load gets inlined CSS and load JavaScript modules async.

Support for secrets

The fly CLI should let users set secrets for production use that are encrypted, and then available to the running app.

Implement Body#json()

We already have .text() and .arrayBuffer().

Should be fairly easy to produce an Object from a JSON source.

App Store clean-up

Initially the point of the app/stores/ folder was to house some default "app stores", but I think the structure is probably wrong.

Might make more sense to put the file store elsewhere (maybe at the root, like the default_context_store) and then put those utils somewhere else too.

Not a dealbreaker, but something to think about maybe.

//cc @jeromegn

req.pathname

This:

req.pathname

Would be much cleaner than this (current solution):

new URL(req.url).pathname

Edge app host names fail for "unknown" reason if they are also attached to a Site

Previously I had a Site, and graduated to a an edge app. Changed the DNS and everything, but

~/P/dreamer-fly *master> fly hostnames --app applepen  add beta.applepen.io
500: something tragic happened, but we're not completely sure what

I think we discussed on Slack. The solution for me was to delete the hostname from the site at https://fly.io/sites/beta-applepen-io/hostnames!

Also wanted to point out other thing. I updated the DNS on my server this morning. Usually for whatever reason (my domain registrar is in my country), DNS stuff works for me quicker than I can type

$ ping flyio-fan-clud.com
#      ^ no, not real ¯\_(ツ)_/¯ 
# but I get this output
PING fly_io_fan_club.edgeapp.net (50.31.246.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2

Perhaps just need to wait. Site loads though.

Allow timeout option on fetch

This will allow devs to make fetch calls with a max timeout, then handle fetches that take too long. It doesn't need to be complex, just enough to let people say "if this request isn't done in 100ms, stop trying and let me do something else.

It might look like:

try{
    let resp = await fetch("https://example.com", { timeout: 100})
}catch(err){
    console.log("too slow")
}

Data must be an ArrayBuffer

Hi there,

First of all, I'm really excited to try out your service..

I'm trying to follow the 'optimize images' example here: https://fly.io/articles/fly-edge-applications-global-javascript/ but am struggling to get it to work (I could be doing something silly).

Here is my index.js file:

fly.http.respondWith(async req => {
	const resp = await fetch("https://raw.githubusercontent.com/bberak/react-native-game-engine/master/logo.png");
	const original = new fly.Image(resp.arrayBuffer());

	let image = original.resize(200).withoutEnlargement();

	image = await image.toImage();

	return new Response(image.data, resp);
});

And here is the error I'm getting:

2018-04-11T07:50:25.091Z - error: [Error: Data must be an ArrayBuffer] 'Error: Data must be an ArrayBuffer\n    at new Image (webpack:///v8env/ts/fly/image.ts:21:13)\n    at fly.http.respondWith (webpack:///index.js:3:1)\n    at <anonymous>'
2018-04-11T07:50:25.091Z - error: error from fetch callback: Error: Data must be an ArrayBuffer

I am using fly v0.28.1. I get this error when running on my localhost and from edgeapp.net. Let me know if I can provider further info.

Any help would be greatly appreciated.

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.