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

Error when trying to use fastify-ws #499

Closed
kristianmandrup opened this issue Nov 30, 2017 · 2 comments
Closed

Error when trying to use fastify-ws #499

kristianmandrup opened this issue Nov 30, 2017 · 2 comments
Labels
question General question about the project

Comments

@kristianmandrup
Copy link

const Fastify = require('fastify')

const fastify = Fastify()
let fastSocket

const fastifyWS = require('fastify-ws')

// Register websocket support
fastify.register(fastifyWS, {
  // library: 'uws' // Use the uws library instead of the default ws library
})

What the ???

/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/node_modules/ajv/lib/compile/resolve.js:222
  return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
                 ^

TypeError: id.replace is not a function
    at Function.normalizeId (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/node_modules/ajv/lib/compile/resolve.js:222:18)
    at Ajv._addSchema (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/node_modules/ajv/lib/ajv.js:311:20)
    at Ajv.compile (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/node_modules/ajv/lib/ajv.js:117:24)
    at Object.schemaCompiler (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/lib/validation.js:112:19)
    at build (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/lib/validation.js:60:26)
    at _fastify.after (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/fastify/fastify.js:403:7)
    at Function._encapsulateThreeParam (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/avvio/boot.js:300:7)
    at Boot.callWithCbOrNextTick (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/avvio/boot.js:252:5)
    at Boot._after (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/avvio/boot.js:203:26)
    at Plugin.exec (/Users/kristianmandrup/repos/tecla5/assignments/my-app/node_modules/avvio/plugin.js:33:17)
@delvedor
Copy link
Member

Can you paste the entire code? I've answered you in #500 and I haven't any kind of problem.

@delvedor delvedor added the question General question about the project label Nov 30, 2017
@delvedor
Copy link
Member

delvedor commented Dec 1, 2017

Closing this, if you have more questions feel free to reopen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General question about the project
Projects
None yet
Development

No branches or pull requests

2 participants