question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The following leaks were detected:core, __core-js_shared__ | Hapi Swagger 8 | Node 8.12.0 | Hapi 16

See original GitHub issue

Context

  • hapi-swagger version: ^8.0.0
  • Node Version: 8.12.0
  • Lab Version: ^16.0.0
  • any other relevant information: Hapi version ^16.0.0

I am using hapi swagger to generate our api documentation. From pasr couple of weeks we have started seeing The following leaks were detected:core, __core-js_shared__ error while running our tests. If I comment out the hapi-swagger require statement, it goes away.

I tried running hapi-swagger tests as well and I guess the issue is with that package as well. Can someone please help here? It is very urgent for us. I don’t want to use -I option with lab to ignore these leak errors. @glennjones

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mautematicocommented, Jun 24, 2019

BWT, hapi-swagger@9 leaks:

The following leaks were detected:__core-js_shared__, core

while hapi-swagger@10 leaks CSS as well:

The following leaks were detected:__core-js_shared__, core, CSS

1reaction
mautematicocommented, Jun 24, 2019

This issue is still present on latest hapi-swagger release, do we have a known fix for this?

diff --git a/lib/plugins/hapi-swagger.js b/lib/plugins/hapi-swagger.js
new file mode 100644
index 0000000..d9ac179
--- /dev/null
+++ b/lib/plugins/hapi-swagger.js
@@ -0,0 +1,27 @@
+'use strict';
+
+const Package = require('../../package.json');
+
+module.exports = {
+    plugins: {
+        options: {
+            schemes: ['https'],
+            host: process.env.PUBLIC_HOST,
+            basePath: '/',
+            info: {
+                version: Package.version
+            },
+            swaggerUI: false,
+            documentationPage: false,
+            securityDefinitions: {
+                'jwt': {
+                    'type': 'apiKey',
+                    'name': 'Authorization',
+                    'in': 'header'
+                }
+            },
+            security: [{ 'jwt': [] }],
+            auth: false
+        }
+    }
+};
diff --git a/package.json b/package.json
index 8f651fd..c8decc9 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
     "@promster/hapi": "^2.2.6",
     "confidence": "^4.0.2",
     "got": "^9.6.0",
+    "hapi-swagger": "^10.0.2",
     "haute-couture": "^3.3.1",
     "knex": "^0.17.6",
     "objection": "^1.6.9",

In the meantime, I’m deploying even when core leaks are present.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The following leaks were detected:core, __core-js_shared__
I am using hapi swagger to generate our api documentation. From pasr couple of weeks we have started seeing The following leaks were...
Read more >
hapi-swagger - npm
A swagger documentation UI generator plugin for hapi. Latest version: 15.0.0, last published: 2 months ago. Start using hapi-swagger in your ...
Read more >
Unable to register hapi-swagger to hapi rest api latest version 17
js:608:3. I tried all permutations and combinations with above code. at the moment nothing is working. Any help will be appreciated.
Read more >
hapi-swagger - npm.io
In your Hapi apps main JavaScript file add the following code to created a Hapi server object. You will also add the routes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found