Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart example app.js code throws errors via koa-router #19

Open
mberkowski opened this issue Jan 3, 2022 · 0 comments
Open

Quickstart example app.js code throws errors via koa-router #19

mberkowski opened this issue Jan 3, 2022 · 0 comments

Comments

@mberkowski
Copy link
Member

The current README Quickstart app.js code

'use strict';
const janus = require('./');
const pubmedPlugin = require('./test/fixtures/pubmed-plugin');
const app = janus({
  uriFactoryPlugins: {pubmed: pubmedPlugin},
});
app.listen(3000);

Does not execute under Node 16 (at least). Koa-router seems to be expecting a string somewhere and getting instead an undefined from the barebones way the example is setup.

/src/src/janus/janus/node_modules/koa-router/node_modules/path-to-regexp/index.js:89
  if (index < str.length) {
                  ^

TypeError: Cannot read properties of undefined (reading 'length')
    at parse (/src/src/janus/janus/node_modules/koa-router/node_modules/path-to-regexp/index.js:89:19)
    at stringToRegexp (/src/src/janus/janus/node_modules/koa-router/node_modules/path-to-regexp/index.js:319:16)
    at pathToRegexp (/src/src/janus/janus/node_modules/koa-router/node_modules/path-to-regexp/index.js:425:10)
    at new Layer (/src/src/janus/janus/node_modules/koa-router/lib/layer.js:47:17)
    at Router.register (/src/src/janus/janus/node_modules/koa-router/lib/router.js:553:15)
    at Router.<computed> [as get] (/src/src/janus/janus/node_modules/koa-router/lib/router.js:202:10)
    at Object.<anonymous> (/src/src/janus/janus/index.js:69:12)
    at r (/src/src/janus/janus/node_modules/stampit/dist/stampit.min.js:1:1596)
    at Object.<anonymous> (/src/src/janus/janus/app.js:4:13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant