-
Notifications
You must be signed in to change notification settings - Fork 420
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
Failed to load API definition @hapi/joi 17.1.0 #648
Comments
I just upgraded to to latest version of Joi and updated the CI test and everything seems to pass https://travis-ci.org/glennjones/hapi-swagger/builds/641452894. Please provide samply repo with issue so I can look into this further. |
Closing since not able to reproduce. |
Sorry for the delay. I have updated to hapi-swagger@12.1.0 and @hapi/joi @ 17.1.0 and now it works. |
The issue is due "Debug: internal, implementation, error. Error: Cannot mix different versions of joi schemas". You can reproduce it using this repo hapi-swagger-incident. Once you have cloned the project you should run yarn, then yarn start, open the link http://localhost:3000/documentation, and it works. |
Try telling yarn to dedupe |
If I try yarn dedupe: error The dedupe command isn't necessary. I think the issue is due a the new change in hapi:
So, the version used does not match the version used by hapi-swagger:
Packages are ok:
|
Reopened issue. Not quite sure how to handle this one yet. |
May be you can add Joi as a peer dependency instead of adding it as fixed dependency, or you can allow allow customize the used version as hapi does, so you can add an option to the plugin to pass Joi, and you can define the version of your package.json as default and this provides retrocompatibility. |
@mastepanoski i think those are great suggestions. |
Sorry for delay fixing this asap. |
Stuck because of a similar issue: |
I'm not having any issues using the following packages:
My server code is:
|
Can anybody help me? I have the same issue. I have tried to install "hapi-swagger" from scratch and everything is OK. But when I want to integrate it with my main project I receive this error.
`'use strict'; require('dotenv').config({path: // Internal Node.js modules // Hapi.js modules // Third party dependencies // Get process environments // Custom dependencies // Tuning the UV_THREADPOOL_SIZE // read certificate and private key const swaggerOptions = { // Create http2 secure server listener // Settings web server const launch = async () => {
}; process.on('unhandledRejection', (err) => { /*
|
@AndriiNyzhnyk apologies but I haven't had the time to refactor the code. Can you dedupe your dependencies and only have one version of Joi? |
@robmcguinness I have tried it, but it no works for me. Also, I set up a "server.validator(Joi)", remove package-lock.json and node_modules and reinstall the dependencies. According to package-lock.json, all dependencies have the same Joi version. I added the link for the all needed files https://send.firefox.com/download/0fabd6135d5d038c/#X6551BJI2iHrTg8tSjLkfw. Do you know any way how to debug it on my local PC or send you log? |
I am not able to view your files. Can you upload a sample project to Github? |
Strange I have checked the link and everything is good. But still, there is a link on full project https://github.com/AndriiNyzhnyk/VideoPortal |
@AndriiNyzhnyk the project doesn't run and neither do unit tests so I could verify. |
OK, I will check, maybe I forgot about something. If any of the tests are broken it is normal behavior (the project on active stage of development) and the Hapi.js ecosystem and Jest are completely new for me. |
@robmcguinness sorry for the delay, I have very intense workload. If I send to you the zipped project, is it work for you? |
Issue
Environment
npx envinfo --npmPackages '*hapi*' --binaries
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
Yarn: 1.21.1 - ~/.nvm/versions/node/v12.14.1/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
npmPackages:
hapi-api-version: ^2.3.1 => 2.3.1
hapi-auth-jwt2: ^8.8.1 => 8.8.1
hapi-swagger: 12.0.0 => 12.0.0
Steps to Reproduce
Expected Behavior
The expected behaviour is upgrade to @hapi/joi 17.1.0, access to the url to see the Swagger documentation and see it like using @hapi/joi 17.0.2.
Joi did not introduce breaking changes in the new minor release Joi Changelog
Actual Behavior
The text was updated successfully, but these errors were encountered: