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

Swagger Client Initialisation is failing. #1460

Closed
jaliph opened this issue Aug 1, 2019 · 8 comments
Closed

Swagger Client Initialisation is failing. #1460

jaliph opened this issue Aug 1, 2019 · 8 comments
Labels

Comments

@jaliph
Copy link

jaliph commented Aug 1, 2019

Getting a sudden error while initialisation of the Swagger.

[ TypeError: Cannot read property 'applyPatch' of undefined
      at Object.a [as applyPatch] (/path/to/node_modules/swagger-client/dist/index.js:1:9824)
      at e.value (/path/to/node_modules/swagger-client/dist/index.js:1:24637)
      at /path/to/node_modules/swagger-client/dist/index.js:1:24394
      at Array.forEach (<anonymous>)
      at e.value (/path/to/node_modules/swagger-client/dist/index.js:1:23989)
      at new e (/path/to/node_modules/swagger-client/dist/index.js:1:20400)
      at a (/path/to/node_modules/swagger-client/dist/index.js:1:19328)
      at t (/path/to/node_modules/swagger-client/dist/index.js:1:14280)
      at Function.o [as resolve] (/path/to/node_modules/swagger-client/dist/index.js:1:14995)
      at a.resolve (/path/to/node_modules/swagger-client/dist/index.js:1:18398)
      at new a (/path/to/node_modules/swagger-client/dist/index.js:1:17450)
      at a (/path/to/node_modules/swagger-client/dist/index.js:1:17408)
      at Promise (/path/to/node_modules/connector-compliance-tests/classes/swaggerApiHelper.js:188:7)
      at new WrappedPromise (/path/to/node_modules/async-listener/es6-wrapped-promise.js:13:18)
      at ApiHelper.doClientInitialisation (/path/to/node_modules/connector-compliance-tests/classes/swaggerApiHelper.js:187:12)
      at Promise.all.swaggerObjectList.map (/path/to/node_modules/connector-compliance-tests/validators/swaggerValidator.js:90:31)
      at Array.map (<anonymous>)
      at Promise (/path/to/node_modules/connector-compliance-tests/validators/swaggerValidator.js:88:35)
      at new WrappedPromise (/path/to/node_modules/async-listener/es6-wrapped-promise.js:13:18)
      at Object.setupSwaggerClient (/path/to/node_modules/connector-compliance-tests/validators/swaggerValidator.js:86:10)
      at Context.<anonymous> (/path/to/node_modules/connector-compliance-tests/testSuite/discoverySwaggerSchemaTests.js:43:32)
      at callFnAsync (/path/to/node_modules/mocha/lib/runnable.js:371:21)
      at Test.Runnable.run (/path/to/node_modules/mocha/lib/runnable.js:318:7)
      at Runner.runTest (/path/to/node_modules/mocha/lib/runner.js:443:10)
      at /path/to/node_modules/mocha/lib/runner.js:549:12
      at next (/path/to/node_modules/mocha/lib/runner.js:361:14)
      at /path/to/node_modules/mocha/lib/runner.js:371:7
      at next (/path/to/node_modules/mocha/lib/runner.js:295:14)
      at Immediate._onImmediate (/path/to/node_modules/mocha/lib/runner.js:339:5)
      at processImmediate (internal/timers.js:443:21) ]

Swagger Client version 3.9.0

@olemoign
Copy link

olemoign commented Aug 1, 2019

Getting same error here.

@alecf
Copy link

alecf commented Aug 1, 2019

I also started getting this, after updating some npm packages... not such which one though

@alecf
Copy link

alecf commented Aug 1, 2019

the problem is version 2.2.0 of fast-json-patch!

@shockey
Copy link
Contributor

shockey commented Aug 1, 2019

Confirmed, installing fast-json-patch@2.2.0 locally is blowing up Swagger Client tests.

I'm going to dig in a bit before taking action, but I'll most likely push out a new Swagger Client patch version that pins fast-json-patch@~2.1.0 today.

@shockey shockey added the P1 label Aug 1, 2019
@shockey
Copy link
Contributor

shockey commented Aug 1, 2019

I've just published swagger-client@3.9.1 directly on top of 3.9.0 (i.e., this release doesn't include the housekeeping items currently on master). Diff here. This version of Swagger Client is pinned to the tighter range, fast-json-patch@~2.1.0, that I mentioned earlier.

This should solve the issue for now, but I'll file an upstream bug with fast-json-patch to let them know it appears an incorrectly-set __esModule flag is causing issues.

Thanks for the help here @jaliph @olemoign @alecf!

@shockey shockey closed this as completed Aug 1, 2019
@olemoign
Copy link

olemoign commented Aug 1, 2019

Man, 100% of the credits to you. :)

@jaliph
Copy link
Author

jaliph commented Aug 2, 2019

@shockey Thanks for the quick resolution

@shockey
Copy link
Contributor

shockey commented Aug 2, 2019

FYI, I've opened the upstream issue with fast-json-patch: Starcounter-Jack/JSON-Patch#233

fangeugene added a commit to the-blue-alliance/the-blue-alliance that referenced this issue Aug 6, 2019
tomalec added a commit to tomalec/swagger-js that referenced this issue Aug 8, 2019
no to use undocumented default export.
Fixes swagger-api#1460
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants