godaddy/kubernetes-client

Ensure webpack will work with (or ignore) static swagger definitions

Open

#273 opened on May 31, 2018

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (206 forks)batch import
help wanted

Repository metrics

Stars
 (954 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I used this...

const Client = require('kubernetes-client').Client;
const config = require('kubernetes-client').config;
const client = new Client({ config: config.fromKubeconfig(), version: '1.8' });

and got this...

WARNING in ./~/kubernetes-client/lib/request.js
Critical dependencies:
13:21-59 the request of a dependency is an expression
 @ ./~/kubernetes-client/lib/request.js 13:21-59

WARNING in ./~/kubernetes-client/lib/specs/swagger-1.9.json.gz
Module parse failed: /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/kubernetes-client/lib/specs/swagger-1.9.json.gz Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '' (1:0)
    at Parser.pp$4.raise (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp$7.getTokenFromCode (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2756:10)
    at Parser.pp$7.readToken (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2477:17)
    at Parser.pp$7.nextToken (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2468:15)
    at Parser.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:515:10)
    at Object.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:3098:39)
    at Parser.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/lib/Parser.js:902:15)
    at NormalModule.<anonymous> (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/lib/NormalModule.js:104:16)
    at NormalModule.onModuleBuild (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    at nextLoader (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
    at /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.finished (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
 @ ./~/kubernetes-client/lib ^\.\/.*$

WARNING in ./~/kubernetes-client/lib/specs/swagger-1.8.json.gz
Module parse failed: /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/kubernetes-client/lib/specs/swagger-1.8.json.gz Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '' (1:0)
    at Parser.pp$4.raise (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp$7.getTokenFromCode (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2756:10)
    at Parser.pp$7.readToken (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2477:17)
    at Parser.pp$7.nextToken (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2468:15)
    at Parser.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:515:10)
    at Object.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:3098:39)
    at Parser.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/lib/Parser.js:902:15)
    at NormalModule.<anonymous> (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/lib/NormalModule.js:104:16)
    at NormalModule.onModuleBuild (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    at nextLoader (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
    at /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.finished (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
 @ ./~/kubernetes-client/lib ^\.\/.*$

WARNING in ./~/kubernetes-client/lib/specs/swagger-1.7.json.gz
Module parse failed: /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/kubernetes-client/lib/specs/swagger-1.7.json.gz Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '' (1:0)
    at Parser.pp$4.raise (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp$7.getTokenFromCode (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2756:10)
    at Parser.pp$7.readToken (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2477:17)
    at Parser.pp$7.nextToken (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:2468:15)
    at Parser.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:515:10)
    at Object.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/node_modules/acorn/dist/acorn.js:3098:39)
    at Parser.parse (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/lib/Parser.js:902:15)
    at NormalModule.<anonymous> (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack/lib/NormalModule.js:104:16)
    at NormalModule.onModuleBuild (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    at nextLoader (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
    at /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.finished (/mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
 @ ./~/kubernetes-client/lib ^\.\/.*$

WARNING in ./~/keyv/src/index.js
Critical dependencies:
18:14-40 the request of a dependency is an expression
 @ ./~/keyv/src/index.js 18:14-40

ERROR in ./~/kubernetes-client/lib/swagger-client.js
Module not found: Error: Cannot resolve module 'fs' in /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/kubernetes-client/lib
 @ ./~/kubernetes-client/lib/swagger-client.js 26:11-24

ERROR in ./~/kubernetes-client/lib/config.js
Module not found: Error: Cannot resolve module 'fs' in /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/kubernetes-client/lib
 @ ./~/kubernetes-client/lib/config.js 4:11-24

ERROR in ./~/kubernetes-client/lib/auth-providers/cmd.js
Module not found: Error: Cannot resolve module 'child_process' in /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/kubernetes-client/lib/auth-providers
 @ ./~/kubernetes-client/lib/auth-providers/cmd.js 9:18-42

ERROR in ./~/forever-agent/index.js
Module not found: Error: Cannot resolve module 'net' in /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/forever-agent
 @ ./~/forever-agent/index.js 6:10-24

ERROR in ./~/forever-agent/index.js
Module not found: Error: Cannot resolve module 'tls' in /mnt/c/linux/repos/shadycuz/kube-vizion/node_modules/forever-agent
 @ ./~/forever-agent/index.js 7:10-24

Is it because my kubeconfig is in yaml? No I don't think so. I switched it to json same issue.

Contributor guide