Coder Social home page Coder Social logo

nanoexpress / legacy Goto Github PK

View Code? Open in Web Editor NEW
107.0 10.0 13.0 10.56 MB

[Deprecated] Nano-framework for Node.js. Use PRO version

Home Page: https://nanoexpress.js.org

License: Apache License 2.0

JavaScript 100.00%
express-like middleware ws fast cplusplus million-request memory-efficient

legacy's Introduction

nanoexpress

Financial Contributors on Open Collective Travis Code Climate Scrutinizer Code Quality NPM Downloads NPM Version size gzipsize GitHub issues

Nano-framework for Node.js

See more info at docs

License

license

legacy's People

Contributors

dalisoft avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar huangang avatar innomaxx avatar joeyshipley avatar monkeywithacupcake avatar phips28 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

legacy's Issues

An in-range update of eslint is breaking the build ๐Ÿšจ

The devDependency eslint was updated from 6.7.2 to 6.8.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • โœ… coverage/coveralls: First build on greenkeeper/eslint-6.8.0 at 30.851% (Details).

Release Notes for v6.8.0
  • c5c7086 Fix: ignore aligning single line in key-spacing (fixes #11414) (#12652) (YeonJuan)
  • 9986d9e Chore: add object option test cases in yield-star-spacing (#12679) (YeonJuan)
  • 1713d07 New: Add no-error-on-unmatched-pattern flag (fixes #10587) (#12377) (ncraley)
  • 5c25a26 Update: autofix bug in lines-between-class-members (fixes #12391) (#12632) (YeonJuan)
  • 4b3cc5c Chore: enable prefer-regex-literals in eslint codebase (#12268) (่–›ๅฎš่ฐ”็š„็Œซ)
  • 05faebb Update: improve suggestion testing experience (#12602) (Brad Zacher)
  • 05f7dd5 Update: Add suggestions for no-unsafe-negation (fixes #12591) (#12609) (Milos Djermanovic)
  • d3e43f1 Docs: Update no-multi-assign explanation (#12615) (Yuping Zuo)
  • 272e4db Fix: no-multiple-empty-lines: Adjust reported loc (#12594) (Tobias Bieniek)
  • a258039 Fix: no-restricted-imports schema allows multiple paths/patterns objects (#12639) (Milos Djermanovic)
  • 51f9620 Fix: improve report location for array-bracket-spacing (#12653) (Milos Djermanovic)
  • 45364af Fix: prefer-numeric-literals doesn't check types of literal arguments (#12655) (Milos Djermanovic)
  • e3c570e Docs: Add example for expression option (#12694) (Arnaud Barrรฉ)
  • 6b774ef Docs: Add spacing in comments for no-console rule (#12696) (Nikki Nikkhoui)
  • 7171fca Chore: refactor regex in config comment parser (#12662) (Milos Djermanovic)
  • 1600648 Update: Allow $schema in config (#12612) (Yordis Prieto)
  • acc0e47 Update: support .eslintrc.cjs (refs eslint/rfcs#43) (#12321) (Evan Plaice)
  • 49c1658 Chore: remove bundling of ESLint during release (#12676) (Kai Cataldo)
  • 257f3d6 Chore: complete to move to GitHub Actions (#12625) (Toru Nagashima)
  • ab912f0 Docs: 1tbs with allowSingleLine edge cases (refs #12284) (#12314) (Ari Kardasis)
  • dd1c30e Sponsors: Sync README with website (ESLint Jenkins)
  • a230f84 Update: include node version in cache (#12582) (Eric Wang)
  • 8b65f17 Chore: remove references to parser demo (#12644) (Kai Cataldo)
  • e9cef99 Docs: wrap {{}} in raw liquid tags to prevent interpolation (#12643) (Kai Cataldo)
  • e707453 Docs: Fix configuration example in no-restricted-imports (fixes #11717) (#12638) (Milos Djermanovic)
  • 19194ce Chore: Add tests to cover default object options in comma-dangle (#12627) (YeonJuan)
  • 6e36d12 Update: do not recommend require-atomic-updates (refs #11899) (#12599) (Kai Cataldo)
Commits

The new version differs by 29 commits.

  • 9738f8c 6.8.0
  • ba59cbf Build: changelog update for 6.8.0
  • c5c7086 Fix: ignore aligning single line in key-spacing (fixes #11414) (#12652)
  • 9986d9e Chore: add object option test cases in yield-star-spacing (#12679)
  • 1713d07 New: Add no-error-on-unmatched-pattern flag (fixes #10587) (#12377)
  • 5c25a26 Update: autofix bug in lines-between-class-members (fixes #12391) (#12632)
  • 4b3cc5c Chore: enable prefer-regex-literals in eslint codebase (#12268)
  • 05faebb Update: improve suggestion testing experience (#12602)
  • 05f7dd5 Update: Add suggestions for no-unsafe-negation (fixes #12591) (#12609)
  • d3e43f1 Docs: Update no-multi-assign explanation (#12615)
  • 272e4db Fix: no-multiple-empty-lines: Adjust reported loc (#12594)
  • a258039 Fix: no-restricted-imports schema allows multiple paths/patterns objects (#12639)
  • 51f9620 Fix: improve report location for array-bracket-spacing (#12653)
  • 45364af Fix: prefer-numeric-literals doesn't check types of literal arguments (#12655)
  • e3c570e Docs: Add example for expression option (#12694)

There are 29 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

[Bug] Throw in async routes doesnt work

 app.setErrorHandler((err: any, req: HttpRequest, res: HttpResponse): any => {
    const errMsg = globalVariables.SETTINGS.ENV === 'local' ? err.error.toString() : null;
    const errStack = globalVariables.SETTINGS.ENV === 'local' ? err.error.stack.toString() : null;
    console.error(errStack);
    res.status(500);
    res.send(
      {
        message: 'Server error',
        errMsg,
        errStack,
      },
    );
  });
`  app.post('/auth/google', async (req: any, res: any) => {
    throw new Error('Invalid google login');
  });
};`

(node:13708) UnhandledPromiseRejectionWarning: Error: Invalid google login
    at F:\Dev\Rmi\Tm86\api-backend\src\routes\logincallbacks.routes.ts:8:11
    at Generator.next (<anonymous>)
    at F:\Dev\Rmi\Tm86\api-backend\src\routes\logincallbacks.routes.ts:8:71
    at new Promise (<anonymous>)
    at __awaiter (F:\Dev\Rmi\Tm86\api-backend\src\routes\logincallbacks.routes.ts:4:12)
    at F:\Dev\Rmi\Tm86\api-backend\src\routes\logincallbacks.routes.ts:7:57
    at handler (F:\Dev\Rmi\Tm86\api-backend\node_modules\nanoexpress\build\nanoexpress.js:1971:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at F:\Dev\Rmi\Tm86\api-backend\node_modules\nanoexpress\build\nanoexpress.js:1749:20
(node:13708) 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: 1)
(node:13708) [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.

With not async methods work perfectly.

Using socket.io + nanoexpress on the same port?

Is this even possible with nanoexpress?

On normal express, it was possible like this:

var app = require('express')();
var http = require('http').createServer(app);
var io = require('socket.io')(http);

http.listen(3000, () => {
  console.log('listening on *:3000');
});

Thanks.

Websocket App publish crashes

When attempting to call app.publish('broadcast', 'test message'); after the app.ws is setup causes the application to silently crash/die.

Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse

Here's a demo file for this error. It's just lists the files of a directory

const path = require('path')
const fs = require('fs')
const nanoexpress = require('nanoexpress')
const util = require('util')
const fsReadDir = util.promisify(fs.readdir)

const app = nanoexpress()
const port = 4000

// list the files of `storage/media` directory
app.get('/', async (req, res) => {
  let files = []

  try {
    files = await fsReadDir(path.resolve(__dirname, '../../storage/media'))
    return res.send({error: false, files})
  } catch (err) {
    return res.send({ error: true })
  }
})

// start server
;(async () => {
  try {
    await app.listen(port, '0.0.0.0')
  } catch (err) {
    console.error(err)
  }
})()

The problem is that every time that i run and the server and send a GET / request, the server throws these warnings

(node:5728) UnhandledPromiseRejectionWarning: Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse.
(node:5728) 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: 1)
(node:5728) [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 problem happens when i call the fsReadDir. If i move the res.send before it, there wont be any warning.

requests with malformed json body hangs and error is not passed to error handler

Posting an invalid json body with Content-Type application/json cause request to hang for aprox 10 seconds before the socket is close and the following is written to the console

(node:25737) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token a in JSON at position 1
    at JSON.parse (<anonymous>)
    at body (/tmp/nanotest/node_modules/nanoexpress/build/nanoexpress.js:559:21)
    at async /tmp/nanotest/node_modules/nanoexpress/build/nanoexpress.js:1659:11
(node:25737) 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: 1)

Sample program:

const nanoexpress = require('nanoexpress');
const app = nanoexpress();
app.setErrorHandler((err, req, resp) => {
    console.log(err);
    resp.status(500).end(err.message);
});
app.setValidationErrorHandler( (err, req, resp) => {
    console.log(err);
    resp.status(500).end(JSON.stringify(err.errors));
});
app.post('/', (req, resp) => {
    resp.send( "sdfsdfdsf");
});
app.listen(4002).catch((...args) => {
    console.log(args)
});

Testing:

curl http://localhost:4002/ -H "Content-Type: application/json"-X POST  --data-binary '{a}' 

notFoundHandler not called

node examples/error-handler.js
> curl localhost:4000/nonexisting
curl: (52) Empty reply from serve

Also a bit weird that the function has signature

    setNotFoundHandler(
      notFoundHandlerCallback: (
        res: HttpRequestBasic,
        req: HttpRequestBasic
      ) => HttpRequestBasic
    ): nanoexpressApp;

when every other method follows the node convention with request, response

Issues integrating with Sapper

Hi there! First off I wanna thank you and Alex for these great projects. Performance is absolutely fantastic for a node.js server, easily beating Express 5x.

While integrating with Sapper (to perform server-side rendering) I ran into a number of issues I believe are bugs. Sapper uses an express middleware to run all the routing etc.

  • req.originalUrl is unimplemented - https://expressjs.com/en/api.html
  • req.baseUrl also appears to be unimplemented but this wasn't a problem for me, just something to look out for?
  • Setting res.statusCode caused the request to hang, with error 'Text and data can only be passed by String, ArrayBuffer or TypedArray.' (this originates from uWebSockets.js) even though res.end sent a string. I was able to fix this temporarily with Object.defineProperty: Object.defineProperty(res, 'statusCode', { set: val => (res.rawStatusCode = val), });. res.status didn't work either and caused the same issue as setting res.statusCode. I'm not sure whether rawStatusCode actually does anything though. I couldn't find any good examples on setting the status code other than skimming https://github.com/dalisoft/nanoexpress/blob/master/src/proto/http/polyfill-chunks/status.js.
  • Normally you're meant to do app.use(sapper.middleware()), but I had to do app.any(sapper.middleware()) with nanoexpress, as the app.use didn't fire at all. Additionally, when using app.any any app.uses would still not fire: app.use((req, res, next) => console.log(req, res) || next()); before the app.any wouldn't cause anything to log.

I also found app.setErrorHandler and app.setNotFoundHandler a bit strange. It's nice and convenient but I can imagine it throwing express veterans off, especially given that app.use doesn't seem to work.

I've been able to fix all of these in my application code, but it was time consuming to figure out what was going wrong. Given that these are all minor issues I figured it would be better to make a single issue. If you need any help with a test case let me know.

http2 support

Hello!

I saw the benchmarks and it looks very promising. I'm thinking about using this library in a microservices project and I was wondering if http2 support is available. Thanks!

UnhandledPromiseRejectionWarning and app.setValidationErrorHandler()

What version of nanoexpress are you using?
1.1.12

Context
I am wanting to validate the structure of the request that is being send to "/uploadSchema". After the validation errors are returned, an "UnhandledPromiseRejectionWarning" is showing in the terminal. The structure of the request is incorrect deliberately.

Request being sent

{
    "schema": {},
    "key": {} // uploadSchema expects a string
}

Expected request structure

{
    "schema": {},
    "key": "someSchemaName"
}

Your code

const nanoexpress = require('nanoexpress');
const app = nanoexpress();
const Ajv = require('ajv');
const ajv = new Ajv({
  validateSchema: false,
  allErrors: true,
  jsonPointers: false,
  ownProperties: true
});

app.post('/uploadSchema', {
    schema: {
      body: {
        type: 'object',
        properties: {
          schema: { type: 'object' },
          key: { type: 'string' },
        },
        required: ["schema", "key"]
      },
      response: false,
      query: false,
      params: false,
      cookies: false
    }
  },
  async (req, res) => {
    res.send({status: 200})
  });

app.setValidationErrorHandler((errors, req, res) => {
  res.end('Validation errors, ' + JSON.stringify(errors));
});

app.listen(4000);
module.exports = app;

Response

Validation errors, {"type":"errors","errors":[{"type":"body","messages":["should be string"]}]}

After a few seconds the following was displayed in the terminal:

(node:16302) UnhandledPromiseRejectionWarning: Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse.
(node:16302) 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:16302) [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.
(node:16302) UnhandledPromiseRejectionWarning: Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse.
(node:16302) 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: 4)

What results did you expect?
I expected there to be no UnhandledPromiseRejectionWarning. I am not sure if this is due to a mistake on my end; however, I see that a recent issue was closed which I believe covers the same issue.

An in-range update of rollup is breaking the build ๐Ÿšจ

The devDependency rollup was updated from 1.14.2 to 1.14.3.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.14.3

2019-06-06

Bug Fixes

  • Generate correct external imports when importing from a directory that would be above the root of the current working directory (#2902)

Pull Requests

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

errorHandling broken in different ways

The following sample shows the problem

const nanoexpress = require('..');
const app = nanoexpress();

app.setErrorHandler( (err, req, res) => {
  res.status(500);
  res.end("Server error");
});
if(process.argv[2]==="middleware") {
  app.use((req,res,next)=>{
    console.log("in middleware");
    next()
  })
}
app.get('/*', (req, res) => {
	req.nonExistingFunc();
	res.end('hello world');
}).listen(4000);

when running without the arg middleware, the node process exits without handling the error in the errorHandler
When running through the middleware, node core dumps

Error: Returning from a request handler without responding or attaching an abort handler is forbidden!
terminate called without an active exception
[1]    27234 abort (core dumped)  node examples/broken-error-handler.js middleware

nanoexpress CJS - End of Life date

Starting at June 1 2020 on project will be added ESM support, but does not remove CJS support and CJS/ESM support will be like PRO version

Update 1: Added note instead of table
Update 2: Update note

ws handler will parse invalid JSON strings without a try catch block causing server to crash on malformed inputs

The bug is located in /src/handler/ws.js

The code fragment that causes the issue is this:

if (options.schema) {
        if (typeof message === 'string') {
          if (message.indexOf('[') === 0 || message.indexOf('{') === 0) {
            if (message.indexOf('[object') === -1) {
              message = JSON.parse(message);
            }
          }
        }

The code will attempt to JSON.parse() a string like {keyWithoutQuotes:stringValueWithoutQuotes} which is an invalid JSON object causing JSON.parse() to throw

uWS + Static

How are headers added to static server and how do you combine the uWS example and the Static example without creating 2 separate servers? I've actually built an app with uWS.SSLApp and I was searching for zero-configuration NginX alternatives, which is how I arrived here thru the Web Frameworks Benchmarks.

Enable CORS

I have a trouble with my POST JSON request: https://stackoverflow.com/questions/60763165/axios-post-stalled-in-chrome

It is CORS issue. How can I write OPTIONS handler with empty body? I tried this, but it did not help for chrome and it does not return anything to Postman until time out.

app.options('/v1/authorizeUser', async (req, res) => {
console.log("OPTIONS authorizeUser");
res.status(200);
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
return res;
});

I tried to use cors middleware but it had no effect

const cors = require('cors');

app.post('/v1/authorizeUser', cors(), async (req) => {
console.log("POST authorizeUser");
const { email, password } = req.body;
console.log(email);
return { status: 'Ok', body: req.body };
});

Method signature inconsistency - setNotFoundHandler

Every method in API has this sequence: req, res but notFound handler has an opposite

  errorHandlerCallback: (
    err: Error,
    req: HttpRequest,
    res: HttpResponse
  ) => HttpResponse

  validationErrorHandlerCallback: (
    errors: validationErrors,
    req: HttpRequest,
    res: HttpResponse
  ) => any

type HttpRoute = (
req: HttpRequest,
res: HttpResponse,
next?: Function,
config?: object,
previousMiddlewareResult?: any
) => any;

  notFoundHandlerCallback: (
    res: HttpResponseBasic,
    req: HttpRequestBasic
  ) => HttpRequestBasic

There is not much users yet, so you can break a backward compatibility and unify it.

JSON body

Version 1.1.8

URL encoded www form data:

{"email":"[email protected]","password":"centrum"}:

    console.log(req);

body: [Object: null prototype] {
'{"email":"[email protected]","password":"centrum"}': ''
}

Nanoexpress thinks that this is a key with empty value.

so this fails:

    const { email, password } = req.body;

Not found handler not activated

I have defined both error and not found handler:

app.setErrorHandler(
    (err, req, res) => {
        return res.send({
            status: 'error',
            status_code: 500,
            message: 'oops'
        })
    }
);

app.setNotFoundHandler((res, req) => {
    return res.send({ code: 404, message: 'You entered wrong url' });
});

This is the handler:

app.post('/bff/polls/:pollId/votes', auth.required, auth.cors, async (req, res) => { /* logic */});

I posted this URL:

http://127.0.0.1:3000/bff/polls/1e420fdqup/vote

And I received no response at all from server. There was a typo in URL, the correct address is:

http://127.0.0.1:3000/bff/polls/1e420fdqup/votes

It seems to be related to dynamic part of URL because I receive 404 error for this URL:

http://127.0.0.1:3000/v1/pols?obd=id&ps=10&lr=id:1e4h34qmef

with this handler:

app.get('/bff/polls/last', auth.optional, async (req, res) => { /* logic */});

Problems when using the examples that include an schema as a middleware

I am getting the following errors:

(node:46753) UnhandledPromiseRejectionWarning: TypeError: schema is not a function
    at uWS.HttpResponse.send (/Users/c.fernandez.traba/Development/Projects/Online%20Coaching%20API/plans/node_modules/nanoexpress/build/nanoexpress.js:866:18)
    at /Users/c.fernandez.traba/Development/Projects/Online%20Coaching%20API/plans/node_modules/nanoexpress/build/nanoexpress.js:1779:20
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

when trying to use the following examples:

https://github.com/nanoexpress/nanoexpress/blob/master/examples/swagger-ui.js
https://github.com/nanoexpress/nanoexpress/blob/master/examples/schema.js

But probably the same is happening for any example where the schemas are set directly as a MW.

I am using node 14.0.0 but i have the same errors under node 10.16.0 and nanoexpress 2.0.1.

Is this documentation up to date: https://nanoexpress.js.org/schemas. ?

Thanks

An in-range update of rollup is breaking the build ๐Ÿšจ

The devDependency rollup was updated from 1.14.6 to 1.15.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

Warning! PRO and PRO (ESM) version will be moved to Private repository

When?

  • Once it gets 2.X
  • 01 March 2020

Who gets access

  • Backers
  • Sponsors

Why?

To keep alive project

History

  • Project was privatized and lost Stargazers twice
  • Only few peoples are Supported project (Sponsors)

I want switch to other framework

  • OK

Related issue

#29

How about security issue

If you about this, then i keep using uWebSockets.js as base, if you want switch, see above

How become Sponsor?

  • Contact directly to ME
  • Patreon (see Sponsor button at repo)

What i can/should do?

If you isn't Sponsor/Backer, see below
If you Sponsor/Backer, you will get access to new repository

  • Migrate to Simple version (Free)
  • Migrate to other library/framework (e.g express?)

Author keeps right of make repository private at any time

An in-range update of rollup is breaking the build ๐Ÿšจ

The devDependency rollup was updated from 1.27.6 to 1.27.7.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).
  • โœ… coverage/coveralls: First build on greenkeeper/rollup-1.27.7 at 30.924% (Details).

Release Notes for v1.27.7

2019-12-01

Bug Fixes

  • Fix a scenario where a reassignments to computed properties were not tracked (#3267)

Pull Requests

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of babel7 is breaking the build ๐Ÿšจ

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.5.5 to 7.6.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

UnhandledPromiseRejectionWarning ??

const html = require('ejs').renderFile(view, Object.assign({}, opts));
res.status(200);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
return res.end(Buffer.from(html, "utf-8"));
(node:8243) UnhandledPromiseRejectionWarning: Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse.
(node:8243) 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().

In the tests I did, sometimes the error appears and sometimes not, but only when using setheader, and only in google chrome.
Firefox tests did not result in the error.

An in-range update of rollup is breaking the build ๐Ÿšจ

The devDependency rollup was updated from 1.18.0 to 1.19.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 6 commits.

  • 9af119d 1.19.0
  • b3f361c Update changelog
  • 456f4d2 Avoid variable from empty module name be empty (#3026)
  • 17eaa43 Use id of last module in chunk as name base for auto-generated chunks (#3025)
  • 871bfa0 Switch to a code-splitting build and update dependencies (#3020)
  • 2443783 Unified file emission api (#2999)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

Options method does not return any data

Preflight options stopped working. When I invoke options method from postman (or chrome) I receive no data. I use cors per route feature as described here: https://nanoexpress.js.org/testing/known-bugs#cors-per-route-bug. I have created an cors origin function and I can see that it is being called.

I tried to remove all dependencies and create the most simple reproducible project: https://github.com/literakl/nano-options. There are two identical servers: nanoexpress and express. When I submit options method from Postman while express variant is running, I receive a response. Then I switch to nanoexpress variant and I receive no response at all.

Can you please tell me what is going on? I went through my changes and the code is identical and it used to work. The same versions are used as well. Is this bug? I lost one day trying to figure out the root cause with no luck. And it is strange that express works in the same scenerio. Thank you

[typescript] Interface 'nanoexpressApp' incorrectly extends interface 'TemplatedApp'.

HI,

I met a error while testing typescript project.

===========================================
node_modules/nanoexpress/nanoexpress.d.ts:166:20 - error TS2430: Interface 'nanoexpressApp' incorrectly extends interface 'TemplatedApp'.
Types of property 'listen' are incompatible.
Type '(port: number, host?: string | undefined) => Promise' is not assignable to type '{ (host: RecognizedString, port: number, cb: (listenSocket: us_listen_socket) => void): TemplatedApp; (port: number, cb: (listenSocket: any) => void): TemplatedApp; }'.
Types of parameters 'port' and 'host' are incompatible.
Type 'RecognizedString' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.

166 export interface nanoexpressApp extends AppTemplatedApp {
~~~~~~~~~~~~~~

Found 1 error.

In my humble opinion, seems uWS's TemplatedApp interface had been changed and the nanoexpress.d.ts was not updated properly.

Could you check it?

User forum

I try to find some resources on this interesting library without luck. Even StackOverflow is empty. The documentation is written for seasoned NodeJS developers and I, as a newbie, cannot even start the server from command line. Is there any forum? Thanks

Disable output to console in non-development environment

Here is my fake code.

image

In production environment it still writes to console, which is unacceptable for me.

image

In package's source code there are no runtime environment checks present.

image

Can you provide some process.env.DEBUG or process.env.NODE_ENV checks?

404 error sometimes

const nanoexpress = require("nanoexpress");
const app = nanoexpress();

app.get("/search", (req, res) => {
  return res.send({ code: 200 });
});

app.listen(3001).then(() => console.log("Listening..."));

then curl http://localhost:3001/search

response looks like this:

โžœ  curl http://localhost:3001/search
{"code":200}%                                                                                                                     
โžœ  curl http://localhost:3001/search
{"code":200}%                                                                                                                     
โžœ  curl http://localhost:3001/search
{"code":404,"message":"The route does not exist"}%                                                                                
โžœ  curl http://localhost:3001/search
{"code":200}%                                                                                                                     
โžœ  curl http://localhost:3001/search
{"code":200}%                                                                                                                     
โžœ  curl http://localhost:3001/search
{"code":200}%                                                                                                                     
โžœ  curl http://localhost:3001/search
{"code":200}%                                                                                                                     
โžœ  curl http://localhost:3001/search
{"code":404,"message":"The route does not exist"}%                                                                                
โžœ  curl http://localhost:3001/search
{"code":200}%  

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.