简体   繁体   中英

S2OError while migrating Loopback3 to Loopback4

We have to migrate several node.js applications from Loopback3 to Loopback4. So the first step we want to do is a basic migration following guidelines ( 1 and 2 ), and then complete it by manually upgrade methods and logic, and completely remove lb3 application.
Unfortunately, at the end of the migration steps in the guide, when trying to start the app ( node -r source-map-support/register . ), we receive the following error:

...
Swagger: skipping unknown type "Document".
Cannot start the application. { S2OError: Could not resolve reference #/definitions/Document
...

Any help would be appreciated.

OK, I had also opened an issue on loopback-next repo on github, at the same time of this question. So this problem has been solved on that thread.

Here the solution:

I've temporarily changed this return type to Object, and it runs successfully and migration goes fine. So I've solved in this way as my scope is to rewrite this specific method. Anyway I have to say the lb3 application runs fine, even though this type is not defined in it.

I hope this may help someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM