Popular New Releases in Addon
anki
ember-cli
Release 4.4.0-beta.1
trojan
v2.13.3
data
treestyletab
Popular Libraries in Addon
by ankitects python
10864 NOASSERTION
Anki for desktop computers
by ember-cli javascript
3314 MIT
The Ember.js command line utility
by Jrohy go
3095 GPL-3.0
trojan多用户管理部署程序, 支持web页面管理
by emberjs javascript
2996 NOASSERTION
A data persistence library for Ember.js.
by mdn javascript
2934 MPL-2.0
Example Firefox add-ons created using the WebExtensions API
by piroor javascript
2522 NOASSERTION
Tree Style Tab, Show tabs like a tree.
by zostera python
2278 BSD-3-Clause
Bootstrap 3 integration with Django.
by greasemonkey javascript
1905 NOASSERTION
Greasemonkey is a user script manager for Firefox.
by Sainan javascript
1540 Unlicense
Don't waste your time with compliance. Universal Bypass circumvents annoying link shorteners.
Trending New libraries in Addon
by Jrohy go
3095 GPL-3.0
trojan多用户管理部署程序, 支持web页面管理
by ubisoft python
1137 GPL-3.0
Add-on for real-time collaboration in Blender.
by ajour rust
875 MIT
A World of Warcraft addon manager written in Rust.
by jayanam python
363 GPL-3.0
Blender 2.8/2.9 mesh and hard surface utilities addon
by dothq typescript
270 MPL-2.0
Dot Browser for Desktop
by Etesam913 css
230 MPL-2.0
:fox_face: A firefox config that has rounded tabs and a url bar that can disappear when not selected on. It works with any theme.
by patriciogonzalezvivo python
215 BSD-3-Clause
Blender addon to create 2D textures from GLSL. It follows the same nomenclature that glslViewer, glslCanvas, glslEditor, ofxShader and PixelSpirit
by 958261649 python
206
MikuMikuRig是一款集生成控制器,自动导入动画,自动布料为一体的blender插件
by alemayhu typescript
180 NOASSERTION
Create Anki flashcards faster, easier and better today ⭐️
Top Authors in Addon
1
116 Libraries
3168
2
28 Libraries
1037
3
24 Libraries
2819
4
23 Libraries
2729
5
21 Libraries
4577
6
21 Libraries
322
7
18 Libraries
157
8
17 Libraries
272
9
17 Libraries
238
10
17 Libraries
5401
1
116 Libraries
3168
2
28 Libraries
1037
3
24 Libraries
2819
4
23 Libraries
2729
5
21 Libraries
4577
6
21 Libraries
322
7
18 Libraries
157
8
17 Libraries
272
9
17 Libraries
238
10
17 Libraries
5401
Trending Kits in Addon
No Trending Kits are available at this moment for Addon
Trending Discussions on Addon
Microk8s dashboard using nginx-ingress via http not working (Error: `no matches for kind "Ingress" in version "extensions/v1beta1"`)
Type Error: this.getOptions is not a function For style-loader
Global SCSS style is no longer loaded in Storybook with Angular 12
Storybook error when using Webpack5 with Next.JS app + Typescript
Colab: (0) UNIMPLEMENTED: DNN library is not found
Minikube dashboard ingress
NPM CI error bindings not accessible from watchpack-chokidar2:fsevents
What should the result be when assigning a variable to a reference to itself, in-between modified and then returned by a function call?
How to penetrate or cut holes through a 2D foreground
Linking local Openssl to Nodejs C++ addon
QUESTION
Microk8s dashboard using nginx-ingress via http not working (Error: `no matches for kind "Ingress" in version "extensions/v1beta1"`)
Asked 2022-Apr-01 at 07:26I have microk8s v1.22.2 running on Ubuntu 20.04.3 LTS.
Output from /etc/hosts
:
1127.0.0.1 localhost
2127.0.1.1 main
3
Excerpt from microk8s status
:
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9
I checked for the running dashboard (kubectl get all --all-namespaces
):
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39
I want to expose the microk8s dashboard within my local network to access it through http://main/dashboard/
To do so, I did the following nano ingress.yaml
:
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56
Enabling the ingress-config through kubectl apply -f ingress.yaml
gave the following error:
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
57
Help would be much appreciated, thanks!
Update: @harsh-manvar pointed out a mismatch in the config version. I have rewritten ingress.yaml to a very stripped down version:
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
57apiVersion: networking.k8s.io/v1
58kind: Ingress
59metadata:
60 name: dashboard
61 namespace: kube-system
62spec:
63 rules:
64 - http:
65 paths:
66 - path: /dashboard
67 pathType: Prefix
68 backend:
69 service:
70 name: kubernetes-dashboard
71 port:
72 number: 443
73
Applying this works. Also, the ingress rule gets created.
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
57apiVersion: networking.k8s.io/v1
58kind: Ingress
59metadata:
60 name: dashboard
61 namespace: kube-system
62spec:
63 rules:
64 - http:
65 paths:
66 - path: /dashboard
67 pathType: Prefix
68 backend:
69 service:
70 name: kubernetes-dashboard
71 port:
72 number: 443
73NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
74kube-system dashboard public * 127.0.0.1 80 11m
75
However, when I access the dashboard through http://<ip-of-kubernetes-master>/dashboard
, I get a 400
error.
Log from the ingress controller:
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
57apiVersion: networking.k8s.io/v1
58kind: Ingress
59metadata:
60 name: dashboard
61 namespace: kube-system
62spec:
63 rules:
64 - http:
65 paths:
66 - path: /dashboard
67 pathType: Prefix
68 backend:
69 service:
70 name: kubernetes-dashboard
71 port:
72 number: 443
73NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
74kube-system dashboard public * 127.0.0.1 80 11m
75192.168.0.123 - - [10/Oct/2021:21:38:47 +0000] "GET /dashboard HTTP/1.1" 400 54 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" 466 0.002 [kube-system-kubernetes-dashboard-443] [] 10.1.76.3:8443 48 0.000 400 ca0946230759edfbaaf9d94f3d5c959a
76
Does the dashboard also need to be exposed using the microk8s proxy
? I thought the ingress controller would take care of this, or did I misunderstand this?
ANSWER
Answered 2021-Oct-10 at 18:291127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
57apiVersion: networking.k8s.io/v1
58kind: Ingress
59metadata:
60 name: dashboard
61 namespace: kube-system
62spec:
63 rules:
64 - http:
65 paths:
66 - path: /dashboard
67 pathType: Prefix
68 backend:
69 service:
70 name: kubernetes-dashboard
71 port:
72 number: 443
73NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
74kube-system dashboard public * 127.0.0.1 80 11m
75192.168.0.123 - - [10/Oct/2021:21:38:47 +0000] "GET /dashboard HTTP/1.1" 400 54 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" 466 0.002 [kube-system-kubernetes-dashboard-443] [] 10.1.76.3:8443 48 0.000 400 ca0946230759edfbaaf9d94f3d5c959a
76error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
77
it' due to the mismatch in the ingress API version.
You are running the v1.22.2 while API version in YAML is old.
Good example : https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
you are using the older ingress API version in your YAML which is extensions/v1beta1
.
You need to change this based on ingress version and K8s version you are running.
This is for version 1.19 in K8s and will work in 1.22 also
Example :
1127.0.0.1 localhost
2127.0.1.1 main
3addons:
4 enabled:
5 dashboard # The Kubernetes dashboard
6 ha-cluster # Configure high availability on the current node
7 ingress # Ingress controller for external access
8 metrics-server # K8s Metrics Server for API access to service metrics
9NAMESPACE NAME READY STATUS RESTARTS AGE
10kube-system pod/calico-node-2jltr 1/1 Running 0 23m
11kube-system pod/calico-kube-controllers-f744bf684-d77hv 1/1 Running 0 23m
12kube-system pod/metrics-server-85df567dd8-jd6gj 1/1 Running 0 22m
13kube-system pod/kubernetes-dashboard-59699458b-pb5jb 1/1 Running 0 21m
14kube-system pod/dashboard-metrics-scraper-58d4977855-94nsp 1/1 Running 0 21m
15ingress pod/nginx-ingress-microk8s-controller-qf5pm 1/1 Running 0 21m
16
17NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
18default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23m
19kube-system service/metrics-server ClusterIP 10.152.183.81 <none> 443/TCP 22m
20kube-system service/kubernetes-dashboard ClusterIP 10.152.183.103 <none> 443/TCP 22m
21kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.197 <none> 8000/TCP 22m
22
23NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
24kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 23m
25ingress daemonset.apps/nginx-ingress-microk8s-controller 1 1 1 1 1 <none> 22m
26
27NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
28kube-system deployment.apps/calico-kube-controllers 1/1 1 1 23m
29kube-system deployment.apps/metrics-server 1/1 1 1 22m
30kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 22m
31kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 22m
32
33NAMESPACE NAME DESIRED CURRENT READY AGE
34kube-system replicaset.apps/calico-kube-controllers-69d7f794d9 0 0 0 23m
35kube-system replicaset.apps/calico-kube-controllers-f744bf684 1 1 1 23m
36kube-system replicaset.apps/metrics-server-85df567dd8 1 1 1 22m
37kube-system replicaset.apps/kubernetes-dashboard-59699458b 1 1 1 21m
38kube-system replicaset.apps/dashboard-metrics-scraper-58d4977855 1 1 1 21m
39apiVersion: extensions/v1beta1
40kind: Ingress
41metadata:
42 annotations:
43 kubernetes.io/ingress.class: public
44 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
45 name: dashboard
46 namespace: kube-system
47spec:
48 rules:
49 - host: main
50 http:
51 paths:
52 - backend:
53 serviceName: kubernetes-dashboard
54 servicePort: 443
55 path: /
56error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
57apiVersion: networking.k8s.io/v1
58kind: Ingress
59metadata:
60 name: dashboard
61 namespace: kube-system
62spec:
63 rules:
64 - http:
65 paths:
66 - path: /dashboard
67 pathType: Prefix
68 backend:
69 service:
70 name: kubernetes-dashboard
71 port:
72 number: 443
73NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
74kube-system dashboard public * 127.0.0.1 80 11m
75192.168.0.123 - - [10/Oct/2021:21:38:47 +0000] "GET /dashboard HTTP/1.1" 400 54 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" 466 0.002 [kube-system-kubernetes-dashboard-443] [] 10.1.76.3:8443 48 0.000 400 ca0946230759edfbaaf9d94f3d5c959a
76error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
77apiVersion: networking.k8s.io/v1
78kind: Ingress
79metadata:
80 name: minimal-ingress
81 annotations:
82 nginx.ingress.kubernetes.io/rewrite-target: /
83spec:
84 rules:
85 - http:
86 paths:
87 - path: /testpath
88 pathType: Prefix
89 backend:
90 service:
91 name: test
92 port:
93 number: 80
94
QUESTION
Type Error: this.getOptions is not a function For style-loader
Asked 2022-Feb-17 at 23:50Problem
While using Storybook, I am running npm run storybook
and getting the error below.
1ModuleBuildError: Module build failed (from ./node_modules/style-loader/dist/cjs.js):
2TypeError: this.getOptions is not a function
3
Background/Context
My goal is to get Storybook to be able to work with sass
.
The setup is a simple one: I have scss
files that get imported by the component file.
In looking up ways to accomplish this, I came across an addon to be able to do so, see this. Essentially, you can run npm i --save-dev @storybook/preset-scss style-loader css-loader sass-loader
.
In doing so, I encountered my first error. It was the same error, but for sass-loader
. This Stack Overflow thread helped me fix that error.
So, I guess in summary, I've tried:
- Following along with the docs (linked above)
- Following along with the Stack Overflow thread (linked above)
Relevant Dev Dependencies
1ModuleBuildError: Module build failed (from ./node_modules/style-loader/dist/cjs.js):
2TypeError: this.getOptions is not a function
3"@storybook/preset-scss": "^1.0.3",
4"css-loader": "^6.2.0",
5"sass-loader": "^10.1.1",
6"style-loader": "^3.2.1"
7
Thanks ahead of time!
ANSWER
Answered 2021-Jul-29 at 17:17Solution
After taking a step back, I realized that I could try out what I did to fix the sass-loader
issue: downgrading major versions.
Steps
- Downgraded
style-loader
1 major version to2.0.0
:npm i style-loader@2.0.0
- Then, as luck would have it, I ran into the same issue with
css-loader
- Downgraded
css-loader
1 major version to5.2.7
:npm i css-loader@5.2.7
Summary
By downgrading all of the loaders one major version, I was able to get it to work.
QUESTION
Global SCSS style is no longer loaded in Storybook with Angular 12
Asked 2022-Feb-14 at 10:46I am migrating a library to use Angular and Material 12 (currently in version 10), and Storybook is used to expose the various components of this library. To do so, I upgraded Angular and Material to version 12 with the Angular Update Guide, Storybook to version 6.3 with npx sb upgrade
and I followed the steps described here to fully migrate Storybook and use webpack5.
Unfortunately, the base.scss file previously included globally in the rendering of stories is no longer included (stories are now without any CSS). This base.scss file is included in a Typescript file with:
import '!style-loader!css-loader!sass-loader!./base.scss';
With Storybook 6.3 and Angular 10, everything works perfectly.
To fix that, I tried to add this configuration in main.js, as it is described in the documentation:
1webpackFinal: async (config, { configType }) => {
2 config.module.rules.push({
3 test: /\.scss$/,
4 use: ['style-loader', 'css-loader', 'sass-loader'],
5 include: path.resolve(__dirname, '../'),
6 });
7 return config;
8 }
9
But I got this error for each of my story:
1webpackFinal: async (config, { configType }) => {
2 config.module.rules.push({
3 test: /\.scss$/,
4 use: ['style-loader', 'css-loader', 'sass-loader'],
5 include: path.resolve(__dirname, '../'),
6 });
7 return config;
8 }
9SassError: SassError: expected "{".
10 ╷
111 │ import api from "!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js";
12 │ ^
13 ╵
14 src\stories\utils\trademarks-format\example-utils-trademarks-format.component.scss 1:98 root stylesheet
15 at Object.callback (D:\bmx\node_modules\@angular-devkit\build-angular\node_modules\sass-loader\dist\index.js:54:16)
16 at Worker.<anonymous> (D:\bmx\node_modules\@angular-devkit\build-angular\src\sass\sass-service.js:134:25)
17 at Worker.emit (events.js:400:28)
18 at MessagePort.<anonymous> (internal/worker.js:236:53)
19 at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24)
20 at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)
21
I have removed node-sass
that was previously installed, I have added sass-loader
, css-loader
, sass
and style-loader
in dev dependencies and I tried to add the @storybook/preset-scss
addon without the custom webpack configuration but it didn't work. I also tried this solution but it didn't work either.
I saw here that it could be an issue with sass-loader in version greater than 10 so I have choosed the 10.1.1 version but I have the impression that the devkit dependency of Angular 12 imports sass-loader in its version 12. Would there be a conflict there? If so, I don't know how to force Angular 12 to use version 10 of sass-loader.
I would be really happy to have a lead that could solve my problem because it's been several days since I feel like I tried everything...
Thank you
ANSWER
Answered 2021-Oct-15 at 14:38I have answered my question. In fact there was no need to change the webpack configuration for my case. It was enough to add the @storybook/preset-scss
addon.
The problem was described here. I needed to downgrade Angular to 12.1 version. I was in 12.2.
Hopefully this helps someone.
QUESTION
Storybook error when using Webpack5 with Next.JS app + Typescript
Asked 2022-Feb-08 at 19:42I am trying to set up a fresh next.js app using Typescript and Storybook.
Following some guides online gets me fairly close but I note that the rendered 'HomePage' story is missing styling
compared with what I get when I simply run
1next dev
2
Based on discussions I found, I thought that it was something to do with storybook using Webpack4 vs Webpack5 (first time working with SB so not 100% sure).
Installing dependencies and updating .storybook/main.js to use webpack5, then running yarn storybook results in the following error.
1next dev
2yarn storybook
3yarn run v1.22.10
4$ start-storybook -p 6006 -s ./public
5info @storybook/react v6.4.9
6info
7(node:2020) DeprecationWarning: --static-dir CLI flag is deprecated, see:
8
9https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated---static-dir-cli-flag
10(Use `node --trace-deprecation ...` to show where the warning was created)
11info => Loading presets
12info => Serving static files from ././public at /
13info => Using implicit CSS loaders
14info => Using default Webpack5 setup
15<i> [webpack-dev-middleware] wait until bundle finished
169% setup compilation DocGenPlugininternal/modules/cjs/loader.js:892
17throw err;
18^
19
20Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
21Require stack:
22- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js
23- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js
24- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\index.js
25- .\node_modules\@storybook\react\dist\cjs\server\framework-preset-react-docgen.js
26- .\node_modules\@storybook\core-common\dist\cjs\presets.js
27- .\node_modules\@storybook\core-common\dist\cjs\index.js
28- .\node_modules\@storybook\core-server\dist\cjs\index.js
29- .\node_modules\@storybook\core\dist\cjs\server.js
30- .\node_modules\@storybook\core\server.js
31- .\node_modules\@storybook\react\dist\cjs\server\index.js
32- .\node_modules\@storybook\react\bin\index.js
33 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
34 at Function.Module._load (internal/modules/cjs/loader.js:745:27)
35 at Module.require (internal/modules/cjs/loader.js:961:19)
36 at require (internal/modules/cjs/helpers.js:92:18)
37 at Object.<anonymous> (.\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js:6:55)
38 at Module._compile (internal/modules/cjs/loader.js:1072:14)
39 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
40 at Module.load (internal/modules/cjs/loader.js:937:32)
41 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
42 at Module.require (internal/modules/cjs/loader.js:961:19)
43 at require (internal/modules/cjs/helpers.js:92:18)
44 at .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js:108:42
45 at _next2 (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:247:1)
46 at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:365:1)
47 at Hook.CALL_DELEGATE [as _call] (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\Hook.js:14:14)
48 at Compiler.newCompilation (.t\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\Compiler.js:1055:26) {
49code: 'MODULE_NOT_FOUND',
50requireStack: [
51 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\dependency.js',
52 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\plugin.js',
53 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\index.js',
54 '.\\@storybook\\react\\dist\\cjs\\server\\framework-preset-react-docgen.js',
55 '.\\@storybook\\core-common\\dist\\cjs\\presets.js',
56 '.\\@storybook\\core-common\\dist\\cjs\\index.js',
57 '.\\@storybook\\core-server\\dist\\cjs\\index.js',
58 '.\\@storybook\\core\\dist\\cjs\\server.js',
59 '.\\@storybook\\core\\server.js',
60 '.\\@storybook\\react\\dist\\cjs\\server\\index.js',
61 '.\\@storybook\\react\\bin\\index.js'
62]
63}
64error Command failed with exit code 1.
65info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
66
.storybook/main.js
1next dev
2yarn storybook
3yarn run v1.22.10
4$ start-storybook -p 6006 -s ./public
5info @storybook/react v6.4.9
6info
7(node:2020) DeprecationWarning: --static-dir CLI flag is deprecated, see:
8
9https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated---static-dir-cli-flag
10(Use `node --trace-deprecation ...` to show where the warning was created)
11info => Loading presets
12info => Serving static files from ././public at /
13info => Using implicit CSS loaders
14info => Using default Webpack5 setup
15<i> [webpack-dev-middleware] wait until bundle finished
169% setup compilation DocGenPlugininternal/modules/cjs/loader.js:892
17throw err;
18^
19
20Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
21Require stack:
22- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js
23- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js
24- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\index.js
25- .\node_modules\@storybook\react\dist\cjs\server\framework-preset-react-docgen.js
26- .\node_modules\@storybook\core-common\dist\cjs\presets.js
27- .\node_modules\@storybook\core-common\dist\cjs\index.js
28- .\node_modules\@storybook\core-server\dist\cjs\index.js
29- .\node_modules\@storybook\core\dist\cjs\server.js
30- .\node_modules\@storybook\core\server.js
31- .\node_modules\@storybook\react\dist\cjs\server\index.js
32- .\node_modules\@storybook\react\bin\index.js
33 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
34 at Function.Module._load (internal/modules/cjs/loader.js:745:27)
35 at Module.require (internal/modules/cjs/loader.js:961:19)
36 at require (internal/modules/cjs/helpers.js:92:18)
37 at Object.<anonymous> (.\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js:6:55)
38 at Module._compile (internal/modules/cjs/loader.js:1072:14)
39 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
40 at Module.load (internal/modules/cjs/loader.js:937:32)
41 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
42 at Module.require (internal/modules/cjs/loader.js:961:19)
43 at require (internal/modules/cjs/helpers.js:92:18)
44 at .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js:108:42
45 at _next2 (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:247:1)
46 at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:365:1)
47 at Hook.CALL_DELEGATE [as _call] (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\Hook.js:14:14)
48 at Compiler.newCompilation (.t\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\Compiler.js:1055:26) {
49code: 'MODULE_NOT_FOUND',
50requireStack: [
51 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\dependency.js',
52 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\plugin.js',
53 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\index.js',
54 '.\\@storybook\\react\\dist\\cjs\\server\\framework-preset-react-docgen.js',
55 '.\\@storybook\\core-common\\dist\\cjs\\presets.js',
56 '.\\@storybook\\core-common\\dist\\cjs\\index.js',
57 '.\\@storybook\\core-server\\dist\\cjs\\index.js',
58 '.\\@storybook\\core\\dist\\cjs\\server.js',
59 '.\\@storybook\\core\\server.js',
60 '.\\@storybook\\react\\dist\\cjs\\server\\index.js',
61 '.\\@storybook\\react\\bin\\index.js'
62]
63}
64error Command failed with exit code 1.
65info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
66module.exports = {
67 "core": {
68 builder: "webpack5"
69 },
70 "stories": [
71 "../stories/**/*.stories.mdx",
72 "../stories/**/*.stories.@(js|jsx|ts|tsx)"
73 ],
74 "addons": [
75 "@storybook/addon-links",
76 "@storybook/addon-essentials"
77 ],
78 "framework": "@storybook/react"
79}
80
.storybook/preview.js
1next dev
2yarn storybook
3yarn run v1.22.10
4$ start-storybook -p 6006 -s ./public
5info @storybook/react v6.4.9
6info
7(node:2020) DeprecationWarning: --static-dir CLI flag is deprecated, see:
8
9https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated---static-dir-cli-flag
10(Use `node --trace-deprecation ...` to show where the warning was created)
11info => Loading presets
12info => Serving static files from ././public at /
13info => Using implicit CSS loaders
14info => Using default Webpack5 setup
15<i> [webpack-dev-middleware] wait until bundle finished
169% setup compilation DocGenPlugininternal/modules/cjs/loader.js:892
17throw err;
18^
19
20Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
21Require stack:
22- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js
23- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js
24- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\index.js
25- .\node_modules\@storybook\react\dist\cjs\server\framework-preset-react-docgen.js
26- .\node_modules\@storybook\core-common\dist\cjs\presets.js
27- .\node_modules\@storybook\core-common\dist\cjs\index.js
28- .\node_modules\@storybook\core-server\dist\cjs\index.js
29- .\node_modules\@storybook\core\dist\cjs\server.js
30- .\node_modules\@storybook\core\server.js
31- .\node_modules\@storybook\react\dist\cjs\server\index.js
32- .\node_modules\@storybook\react\bin\index.js
33 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
34 at Function.Module._load (internal/modules/cjs/loader.js:745:27)
35 at Module.require (internal/modules/cjs/loader.js:961:19)
36 at require (internal/modules/cjs/helpers.js:92:18)
37 at Object.<anonymous> (.\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js:6:55)
38 at Module._compile (internal/modules/cjs/loader.js:1072:14)
39 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
40 at Module.load (internal/modules/cjs/loader.js:937:32)
41 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
42 at Module.require (internal/modules/cjs/loader.js:961:19)
43 at require (internal/modules/cjs/helpers.js:92:18)
44 at .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js:108:42
45 at _next2 (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:247:1)
46 at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:365:1)
47 at Hook.CALL_DELEGATE [as _call] (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\Hook.js:14:14)
48 at Compiler.newCompilation (.t\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\Compiler.js:1055:26) {
49code: 'MODULE_NOT_FOUND',
50requireStack: [
51 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\dependency.js',
52 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\plugin.js',
53 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\index.js',
54 '.\\@storybook\\react\\dist\\cjs\\server\\framework-preset-react-docgen.js',
55 '.\\@storybook\\core-common\\dist\\cjs\\presets.js',
56 '.\\@storybook\\core-common\\dist\\cjs\\index.js',
57 '.\\@storybook\\core-server\\dist\\cjs\\index.js',
58 '.\\@storybook\\core\\dist\\cjs\\server.js',
59 '.\\@storybook\\core\\server.js',
60 '.\\@storybook\\react\\dist\\cjs\\server\\index.js',
61 '.\\@storybook\\react\\bin\\index.js'
62]
63}
64error Command failed with exit code 1.
65info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
66module.exports = {
67 "core": {
68 builder: "webpack5"
69 },
70 "stories": [
71 "../stories/**/*.stories.mdx",
72 "../stories/**/*.stories.@(js|jsx|ts|tsx)"
73 ],
74 "addons": [
75 "@storybook/addon-links",
76 "@storybook/addon-essentials"
77 ],
78 "framework": "@storybook/react"
79}
80import "../styles/globals.css";
81import * as NextImage from "next/image";
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, "default", {
86 configurable: true,
87 value: (props) => <OriginalNextImage {...props} unoptimized />,
88});
89
90export const parameters = {
91actions: { argTypesRegex: "^on[A-Z].*" },
92controls: {
93 matchers: {
94 color: /(background|color)$/i,
95 date: /Date$/,
96 },
97},
98}
99
package.json
1next dev
2yarn storybook
3yarn run v1.22.10
4$ start-storybook -p 6006 -s ./public
5info @storybook/react v6.4.9
6info
7(node:2020) DeprecationWarning: --static-dir CLI flag is deprecated, see:
8
9https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated---static-dir-cli-flag
10(Use `node --trace-deprecation ...` to show where the warning was created)
11info => Loading presets
12info => Serving static files from ././public at /
13info => Using implicit CSS loaders
14info => Using default Webpack5 setup
15<i> [webpack-dev-middleware] wait until bundle finished
169% setup compilation DocGenPlugininternal/modules/cjs/loader.js:892
17throw err;
18^
19
20Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
21Require stack:
22- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js
23- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js
24- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\index.js
25- .\node_modules\@storybook\react\dist\cjs\server\framework-preset-react-docgen.js
26- .\node_modules\@storybook\core-common\dist\cjs\presets.js
27- .\node_modules\@storybook\core-common\dist\cjs\index.js
28- .\node_modules\@storybook\core-server\dist\cjs\index.js
29- .\node_modules\@storybook\core\dist\cjs\server.js
30- .\node_modules\@storybook\core\server.js
31- .\node_modules\@storybook\react\dist\cjs\server\index.js
32- .\node_modules\@storybook\react\bin\index.js
33 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
34 at Function.Module._load (internal/modules/cjs/loader.js:745:27)
35 at Module.require (internal/modules/cjs/loader.js:961:19)
36 at require (internal/modules/cjs/helpers.js:92:18)
37 at Object.<anonymous> (.\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js:6:55)
38 at Module._compile (internal/modules/cjs/loader.js:1072:14)
39 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
40 at Module.load (internal/modules/cjs/loader.js:937:32)
41 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
42 at Module.require (internal/modules/cjs/loader.js:961:19)
43 at require (internal/modules/cjs/helpers.js:92:18)
44 at .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js:108:42
45 at _next2 (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:247:1)
46 at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:365:1)
47 at Hook.CALL_DELEGATE [as _call] (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\Hook.js:14:14)
48 at Compiler.newCompilation (.t\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\Compiler.js:1055:26) {
49code: 'MODULE_NOT_FOUND',
50requireStack: [
51 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\dependency.js',
52 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\plugin.js',
53 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\index.js',
54 '.\\@storybook\\react\\dist\\cjs\\server\\framework-preset-react-docgen.js',
55 '.\\@storybook\\core-common\\dist\\cjs\\presets.js',
56 '.\\@storybook\\core-common\\dist\\cjs\\index.js',
57 '.\\@storybook\\core-server\\dist\\cjs\\index.js',
58 '.\\@storybook\\core\\dist\\cjs\\server.js',
59 '.\\@storybook\\core\\server.js',
60 '.\\@storybook\\react\\dist\\cjs\\server\\index.js',
61 '.\\@storybook\\react\\bin\\index.js'
62]
63}
64error Command failed with exit code 1.
65info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
66module.exports = {
67 "core": {
68 builder: "webpack5"
69 },
70 "stories": [
71 "../stories/**/*.stories.mdx",
72 "../stories/**/*.stories.@(js|jsx|ts|tsx)"
73 ],
74 "addons": [
75 "@storybook/addon-links",
76 "@storybook/addon-essentials"
77 ],
78 "framework": "@storybook/react"
79}
80import "../styles/globals.css";
81import * as NextImage from "next/image";
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, "default", {
86 configurable: true,
87 value: (props) => <OriginalNextImage {...props} unoptimized />,
88});
89
90export const parameters = {
91actions: { argTypesRegex: "^on[A-Z].*" },
92controls: {
93 matchers: {
94 color: /(background|color)$/i,
95 date: /Date$/,
96 },
97},
98}
99{
100 "name": "client",
101 "private": true,
102 "scripts": {
103 "dev": "next dev",
104 "build": "next build",
105 "start": "next start",
106 "lint": "next lint",
107 "storybook": "start-storybook -p 6006 -s ./public",
108 "build-storybook": "build-storybook -s ./public"
109 },
110 "dependencies": {
111 "next": "12.0.7",
112 "react": "17.0.2",
113 "react-dom": "17.0.2"
114 },
115 "devDependencies": {
116 "@babel/core": "^7.16.7",
117 "@storybook/addon-actions": "^6.4.9",
118 "@storybook/addon-essentials": "^6.4.9",
119 "@storybook/addon-links": "^6.4.9",
120 "@storybook/builder-webpack5": "^6.4.9",
121 "@storybook/manager-webpack5": "^6.4.9",
122 "@storybook/react": "^6.4.9",
123 "@types/node": "17.0.8",
124 "@types/react": "17.0.38",
125 "babel-loader": "^8.2.3",
126 "eslint": "8.6.0",
127 "eslint-config-next": "12.0.7",
128 "eslint-plugin-storybook": "^0.5.5",
129 "typescript": "4.5.4"
130 }
131}
132
Steps to reproduce:
- npx create-next-app@latest --typescript
- cd my-app
- npx sb init
- n for eslint-plugin-storybook plugin fix
- yarn add @storybook/builder-webpack5 @storybook/manager-webpack5 --dev
- Update .storybook/main.js to include "core": { builder: "webpack5" }
- yarn storybook and hit error
Other than this process, I have tried:
- Creating react apps with Storybook, then migrating to next.js with typescript
- Creating next apps with Storybook, then introducing Typescript
Both result in the same error...
Interestingly, when following the steps to reproduce with a non-typescript next.js app, everything seems to work fine and the 'HomePage' story is rendered correctly, so maybe some issue with Storybook playing nicely with Typescript? Or maybe missing dependencies?
Any input / point in the right direction would be greatly appreciated.
ANSWER
Answered 2022-Feb-08 at 19:42Found the answer here -> https://github.com/storybookjs/storybook/issues/15336
The solution is simply to add the following to .storybook\main.js
1next dev
2yarn storybook
3yarn run v1.22.10
4$ start-storybook -p 6006 -s ./public
5info @storybook/react v6.4.9
6info
7(node:2020) DeprecationWarning: --static-dir CLI flag is deprecated, see:
8
9https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated---static-dir-cli-flag
10(Use `node --trace-deprecation ...` to show where the warning was created)
11info => Loading presets
12info => Serving static files from ././public at /
13info => Using implicit CSS loaders
14info => Using default Webpack5 setup
15<i> [webpack-dev-middleware] wait until bundle finished
169% setup compilation DocGenPlugininternal/modules/cjs/loader.js:892
17throw err;
18^
19
20Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
21Require stack:
22- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js
23- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js
24- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\index.js
25- .\node_modules\@storybook\react\dist\cjs\server\framework-preset-react-docgen.js
26- .\node_modules\@storybook\core-common\dist\cjs\presets.js
27- .\node_modules\@storybook\core-common\dist\cjs\index.js
28- .\node_modules\@storybook\core-server\dist\cjs\index.js
29- .\node_modules\@storybook\core\dist\cjs\server.js
30- .\node_modules\@storybook\core\server.js
31- .\node_modules\@storybook\react\dist\cjs\server\index.js
32- .\node_modules\@storybook\react\bin\index.js
33 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
34 at Function.Module._load (internal/modules/cjs/loader.js:745:27)
35 at Module.require (internal/modules/cjs/loader.js:961:19)
36 at require (internal/modules/cjs/helpers.js:92:18)
37 at Object.<anonymous> (.\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js:6:55)
38 at Module._compile (internal/modules/cjs/loader.js:1072:14)
39 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
40 at Module.load (internal/modules/cjs/loader.js:937:32)
41 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
42 at Module.require (internal/modules/cjs/loader.js:961:19)
43 at require (internal/modules/cjs/helpers.js:92:18)
44 at .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js:108:42
45 at _next2 (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:247:1)
46 at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:365:1)
47 at Hook.CALL_DELEGATE [as _call] (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\Hook.js:14:14)
48 at Compiler.newCompilation (.t\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\Compiler.js:1055:26) {
49code: 'MODULE_NOT_FOUND',
50requireStack: [
51 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\dependency.js',
52 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\plugin.js',
53 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\index.js',
54 '.\\@storybook\\react\\dist\\cjs\\server\\framework-preset-react-docgen.js',
55 '.\\@storybook\\core-common\\dist\\cjs\\presets.js',
56 '.\\@storybook\\core-common\\dist\\cjs\\index.js',
57 '.\\@storybook\\core-server\\dist\\cjs\\index.js',
58 '.\\@storybook\\core\\dist\\cjs\\server.js',
59 '.\\@storybook\\core\\server.js',
60 '.\\@storybook\\react\\dist\\cjs\\server\\index.js',
61 '.\\@storybook\\react\\bin\\index.js'
62]
63}
64error Command failed with exit code 1.
65info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
66module.exports = {
67 "core": {
68 builder: "webpack5"
69 },
70 "stories": [
71 "../stories/**/*.stories.mdx",
72 "../stories/**/*.stories.@(js|jsx|ts|tsx)"
73 ],
74 "addons": [
75 "@storybook/addon-links",
76 "@storybook/addon-essentials"
77 ],
78 "framework": "@storybook/react"
79}
80import "../styles/globals.css";
81import * as NextImage from "next/image";
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, "default", {
86 configurable: true,
87 value: (props) => <OriginalNextImage {...props} unoptimized />,
88});
89
90export const parameters = {
91actions: { argTypesRegex: "^on[A-Z].*" },
92controls: {
93 matchers: {
94 color: /(background|color)$/i,
95 date: /Date$/,
96 },
97},
98}
99{
100 "name": "client",
101 "private": true,
102 "scripts": {
103 "dev": "next dev",
104 "build": "next build",
105 "start": "next start",
106 "lint": "next lint",
107 "storybook": "start-storybook -p 6006 -s ./public",
108 "build-storybook": "build-storybook -s ./public"
109 },
110 "dependencies": {
111 "next": "12.0.7",
112 "react": "17.0.2",
113 "react-dom": "17.0.2"
114 },
115 "devDependencies": {
116 "@babel/core": "^7.16.7",
117 "@storybook/addon-actions": "^6.4.9",
118 "@storybook/addon-essentials": "^6.4.9",
119 "@storybook/addon-links": "^6.4.9",
120 "@storybook/builder-webpack5": "^6.4.9",
121 "@storybook/manager-webpack5": "^6.4.9",
122 "@storybook/react": "^6.4.9",
123 "@types/node": "17.0.8",
124 "@types/react": "17.0.38",
125 "babel-loader": "^8.2.3",
126 "eslint": "8.6.0",
127 "eslint-config-next": "12.0.7",
128 "eslint-plugin-storybook": "^0.5.5",
129 "typescript": "4.5.4"
130 }
131}
132reactDocgen: false
133
Resulting .storybook\main.js looks like so
1next dev
2yarn storybook
3yarn run v1.22.10
4$ start-storybook -p 6006 -s ./public
5info @storybook/react v6.4.9
6info
7(node:2020) DeprecationWarning: --static-dir CLI flag is deprecated, see:
8
9https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated---static-dir-cli-flag
10(Use `node --trace-deprecation ...` to show where the warning was created)
11info => Loading presets
12info => Serving static files from ././public at /
13info => Using implicit CSS loaders
14info => Using default Webpack5 setup
15<i> [webpack-dev-middleware] wait until bundle finished
169% setup compilation DocGenPlugininternal/modules/cjs/loader.js:892
17throw err;
18^
19
20Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
21Require stack:
22- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js
23- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js
24- .\node_modules\@storybook\react-docgen-typescript-plugin\dist\index.js
25- .\node_modules\@storybook\react\dist\cjs\server\framework-preset-react-docgen.js
26- .\node_modules\@storybook\core-common\dist\cjs\presets.js
27- .\node_modules\@storybook\core-common\dist\cjs\index.js
28- .\node_modules\@storybook\core-server\dist\cjs\index.js
29- .\node_modules\@storybook\core\dist\cjs\server.js
30- .\node_modules\@storybook\core\server.js
31- .\node_modules\@storybook\react\dist\cjs\server\index.js
32- .\node_modules\@storybook\react\bin\index.js
33 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
34 at Function.Module._load (internal/modules/cjs/loader.js:745:27)
35 at Module.require (internal/modules/cjs/loader.js:961:19)
36 at require (internal/modules/cjs/helpers.js:92:18)
37 at Object.<anonymous> (.\node_modules\@storybook\react-docgen-typescript-plugin\dist\dependency.js:6:55)
38 at Module._compile (internal/modules/cjs/loader.js:1072:14)
39 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
40 at Module.load (internal/modules/cjs/loader.js:937:32)
41 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
42 at Module.require (internal/modules/cjs/loader.js:961:19)
43 at require (internal/modules/cjs/helpers.js:92:18)
44 at .\node_modules\@storybook\react-docgen-typescript-plugin\dist\plugin.js:108:42
45 at _next2 (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:247:1)
46 at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:365:1)
47 at Hook.CALL_DELEGATE [as _call] (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\Hook.js:14:14)
48 at Compiler.newCompilation (.t\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\Compiler.js:1055:26) {
49code: 'MODULE_NOT_FOUND',
50requireStack: [
51 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\dependency.js',
52 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\plugin.js',
53 '.\\@storybook\\react-docgen-typescript-plugin\\dist\\index.js',
54 '.\\@storybook\\react\\dist\\cjs\\server\\framework-preset-react-docgen.js',
55 '.\\@storybook\\core-common\\dist\\cjs\\presets.js',
56 '.\\@storybook\\core-common\\dist\\cjs\\index.js',
57 '.\\@storybook\\core-server\\dist\\cjs\\index.js',
58 '.\\@storybook\\core\\dist\\cjs\\server.js',
59 '.\\@storybook\\core\\server.js',
60 '.\\@storybook\\react\\dist\\cjs\\server\\index.js',
61 '.\\@storybook\\react\\bin\\index.js'
62]
63}
64error Command failed with exit code 1.
65info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
66module.exports = {
67 "core": {
68 builder: "webpack5"
69 },
70 "stories": [
71 "../stories/**/*.stories.mdx",
72 "../stories/**/*.stories.@(js|jsx|ts|tsx)"
73 ],
74 "addons": [
75 "@storybook/addon-links",
76 "@storybook/addon-essentials"
77 ],
78 "framework": "@storybook/react"
79}
80import "../styles/globals.css";
81import * as NextImage from "next/image";
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, "default", {
86 configurable: true,
87 value: (props) => <OriginalNextImage {...props} unoptimized />,
88});
89
90export const parameters = {
91actions: { argTypesRegex: "^on[A-Z].*" },
92controls: {
93 matchers: {
94 color: /(background|color)$/i,
95 date: /Date$/,
96 },
97},
98}
99{
100 "name": "client",
101 "private": true,
102 "scripts": {
103 "dev": "next dev",
104 "build": "next build",
105 "start": "next start",
106 "lint": "next lint",
107 "storybook": "start-storybook -p 6006 -s ./public",
108 "build-storybook": "build-storybook -s ./public"
109 },
110 "dependencies": {
111 "next": "12.0.7",
112 "react": "17.0.2",
113 "react-dom": "17.0.2"
114 },
115 "devDependencies": {
116 "@babel/core": "^7.16.7",
117 "@storybook/addon-actions": "^6.4.9",
118 "@storybook/addon-essentials": "^6.4.9",
119 "@storybook/addon-links": "^6.4.9",
120 "@storybook/builder-webpack5": "^6.4.9",
121 "@storybook/manager-webpack5": "^6.4.9",
122 "@storybook/react": "^6.4.9",
123 "@types/node": "17.0.8",
124 "@types/react": "17.0.38",
125 "babel-loader": "^8.2.3",
126 "eslint": "8.6.0",
127 "eslint-config-next": "12.0.7",
128 "eslint-plugin-storybook": "^0.5.5",
129 "typescript": "4.5.4"
130 }
131}
132reactDocgen: false
133module.exports = {
134 "core": {
135 builder: "webpack5"
136 },
137 "stories": [
138 "../stories/**/*.stories.mdx",
139 "../stories/**/*.stories.@(js|jsx|ts|tsx)"
140 ],
141 "addons": [
142 "@storybook/addon-links",
143 "@storybook/addon-essentials"
144 ],
145 "framework": "@storybook/react",
146 typescript: {
147 check: false,
148 checkOptions: {},
149 reactDocgen: false,
150 reactDocgenTypescriptOptions: {
151 shouldExtractLiteralValuesFromEnum: true,
152 propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
153 },
154 },
155}
156
QUESTION
Colab: (0) UNIMPLEMENTED: DNN library is not found
Asked 2022-Feb-08 at 19:27I have pretrained model for object detection (Google Colab + TensorFlow) inside Google Colab and I run it two-three times per week for new images I have and everything was fine for the last year till this week. Now when I try to run model I have this message:
1Graph execution error:
2
32 root error(s) found.
4 (0) UNIMPLEMENTED: DNN library is not found.
5 [[{{node functional_1/conv1_conv/Conv2D}}]]
6 [[StatefulPartitionedCall/SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/Reshape_5/_126]]
7 (1) UNIMPLEMENTED: DNN library is not found.
8 [[{{node functional_1/conv1_conv/Conv2D}}]]
90 successful operations.
100 derived errors ignored. [Op:__inference_restored_function_body_27380] ***
11
Never happended before.
Before I can run my model I have to install Tensor Flow object detection API with this command:
1Graph execution error:
2
32 root error(s) found.
4 (0) UNIMPLEMENTED: DNN library is not found.
5 [[{{node functional_1/conv1_conv/Conv2D}}]]
6 [[StatefulPartitionedCall/SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/Reshape_5/_126]]
7 (1) UNIMPLEMENTED: DNN library is not found.
8 [[{{node functional_1/conv1_conv/Conv2D}}]]
90 successful operations.
100 derived errors ignored. [Op:__inference_restored_function_body_27380] ***
11import os
12
13os.chdir('/project/models/research')
14
15!protoc object_detection/protos/*.proto --python_out=.
16!cp object_detection/packages/tf2/setup.py .
17!python -m pip install .
18
This is the output of command:
1Graph execution error:
2
32 root error(s) found.
4 (0) UNIMPLEMENTED: DNN library is not found.
5 [[{{node functional_1/conv1_conv/Conv2D}}]]
6 [[StatefulPartitionedCall/SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/Reshape_5/_126]]
7 (1) UNIMPLEMENTED: DNN library is not found.
8 [[{{node functional_1/conv1_conv/Conv2D}}]]
90 successful operations.
100 derived errors ignored. [Op:__inference_restored_function_body_27380] ***
11import os
12
13os.chdir('/project/models/research')
14
15!protoc object_detection/protos/*.proto --python_out=.
16!cp object_detection/packages/tf2/setup.py .
17!python -m pip install .
18Processing /content/gdrive/MyDrive/models/research
19 DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
20 pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
21Collecting avro-python3
22 Downloading avro-python3-1.10.2.tar.gz (38 kB)
23Collecting apache-beam
24 Downloading apache_beam-2.35.0-cp37-cp37m-manylinux2010_x86_64.whl (9.9 MB)
25 |████████████████████████████████| 9.9 MB 1.6 MB/s
26Requirement already satisfied: pillow in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (7.1.2)
27Requirement already satisfied: lxml in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (4.2.6)
28Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (3.2.2)
29Requirement already satisfied: Cython in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (0.29.27)
30Requirement already satisfied: contextlib2 in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (0.5.5)
31Collecting tf-slim
32 Downloading tf_slim-1.1.0-py2.py3-none-any.whl (352 kB)
33 |████████████████████████████████| 352 kB 50.5 MB/s
34Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (1.15.0)
35Requirement already satisfied: pycocotools in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (2.0.4)
36Collecting lvis
37 Downloading lvis-0.5.3-py3-none-any.whl (14 kB)
38Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (1.4.1)
39Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (1.3.5)
40Collecting tf-models-official>=2.5.1
41 Downloading tf_models_official-2.8.0-py2.py3-none-any.whl (2.2 MB)
42 |████████████████████████████████| 2.2 MB 38.3 MB/s
43Collecting tensorflow_io
44 Downloading tensorflow_io-0.24.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (23.4 MB)
45 |████████████████████████████████| 23.4 MB 1.7 MB/s
46Requirement already satisfied: keras in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (2.7.0)
47Collecting opencv-python-headless
48 Downloading opencv_python_headless-4.5.5.62-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (47.7 MB)
49 |████████████████████████████████| 47.7 MB 74 kB/s
50Collecting sacrebleu
51 Downloading sacrebleu-2.0.0-py3-none-any.whl (90 kB)
52 |████████████████████████████████| 90 kB 10.4 MB/s
53Requirement already satisfied: kaggle>=1.3.9 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.5.12)
54Requirement already satisfied: psutil>=5.4.3 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (5.4.8)
55Requirement already satisfied: oauth2client in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (4.1.3)
56Collecting tensorflow-addons
57 Downloading tensorflow_addons-0.15.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
58 |████████████████████████████████| 1.1 MB 37.8 MB/s
59Requirement already satisfied: gin-config in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (0.5.0)
60Requirement already satisfied: tensorflow-datasets in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (4.0.1)
61Collecting sentencepiece
62 Downloading sentencepiece-0.1.96-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
63 |████████████████████████████████| 1.2 MB 37.5 MB/s
64Collecting tensorflow-model-optimization>=0.4.1
65 Downloading tensorflow_model_optimization-0.7.0-py2.py3-none-any.whl (213 kB)
66 |████████████████████████████████| 213 kB 42.7 MB/s
67Collecting pyyaml<6.0,>=5.1
68 Downloading PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636 kB)
69 |████████████████████████████████| 636 kB 53.3 MB/s
70Collecting tensorflow-text~=2.8.0
71 Downloading tensorflow_text-2.8.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.9 MB)
72 |████████████████████████████████| 4.9 MB 46.1 MB/s
73Requirement already satisfied: google-api-python-client>=1.6.7 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.12.10)
74Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.19.5)
75Requirement already satisfied: tensorflow-hub>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (0.12.0)
76Collecting seqeval
77 Downloading seqeval-1.2.2.tar.gz (43 kB)
78 |████████████████████████████████| 43 kB 2.1 MB/s
79Collecting tensorflow~=2.8.0
80 Downloading tensorflow-2.8.0-cp37-cp37m-manylinux2010_x86_64.whl (497.5 MB)
81 |████████████████████████████████| 497.5 MB 28 kB/s
82Collecting py-cpuinfo>=3.3.0
83 Downloading py-cpuinfo-8.0.0.tar.gz (99 kB)
84 |████████████████████████████████| 99 kB 10.1 MB/s
85Requirement already satisfied: google-auth<3dev,>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (1.35.0)
86Requirement already satisfied: uritemplate<4dev,>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.0.1)
87Requirement already satisfied: httplib2<1dev,>=0.15.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.17.4)
88Requirement already satisfied: google-auth-httplib2>=0.0.3 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.0.4)
89Requirement already satisfied: google-api-core<3dev,>=1.21.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (1.26.3)
90Requirement already satisfied: setuptools>=40.3.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (57.4.0)
91Requirement already satisfied: pytz in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2018.9)
92Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (1.54.0)
93Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2.23.0)
94Requirement already satisfied: packaging>=14.3 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (21.3)
95Requirement already satisfied: protobuf>=3.12.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.17.3)
96Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.2.8)
97Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (4.8)
98Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (4.2.4)
99Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (2021.10.8)
100Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (1.24.3)
101Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (2.8.2)
102Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (4.62.3)
103Requirement already satisfied: python-slugify in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (5.0.2)
104Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=14.3->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.0.7)
105Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.4.8)
106Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2.10)
107Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.0.4)
108Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.1.0)
109Requirement already satisfied: libclang>=9.0.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (13.0.0)
110Requirement already satisfied: h5py>=2.9.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.1.0)
111Requirement already satisfied: astunparse>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.6.3)
112Requirement already satisfied: gast>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.4.0)
113Requirement already satisfied: google-pasta>=0.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.2.0)
114Requirement already satisfied: typing-extensions>=3.6.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.10.0.2)
115Requirement already satisfied: wrapt>=1.11.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.13.3)
116Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.23.1)
117Collecting tf-estimator-nightly==2.8.0.dev2021122109
118 Downloading tf_estimator_nightly-2.8.0.dev2021122109-py2.py3-none-any.whl (462 kB)
119 |████████████████████████████████| 462 kB 49.5 MB/s
120Requirement already satisfied: keras-preprocessing>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.1.2)
121Collecting tensorboard<2.9,>=2.8
122 Downloading tensorboard-2.8.0-py3-none-any.whl (5.8 MB)
123 |████████████████████████████████| 5.8 MB 41.2 MB/s
124Requirement already satisfied: flatbuffers>=1.12 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (2.0)
125Collecting keras
126 Downloading keras-2.8.0-py2.py3-none-any.whl (1.4 MB)
127 |████████████████████████████████| 1.4 MB 41.2 MB/s
128Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.3.0)
129Collecting numpy>=1.15.4
130 Downloading numpy-1.21.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
131 |████████████████████████████████| 15.7 MB 41.4 MB/s
132Requirement already satisfied: absl-py>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.0.0)
133Requirement already satisfied: grpcio<2.0,>=1.24.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.43.0)
134Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/lib/python3.7/dist-packages (from astunparse>=1.6.0->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.37.1)
135Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py>=2.9.0->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.5.2)
136Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.6.1)
137Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.0.1)
138Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.4.6)
139Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.8.1)
140Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.3.6)
141Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.3.1)
142Requirement already satisfied: importlib-metadata>=4.4 in /usr/local/lib/python3.7/dist-packages (from markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (4.10.1)
143Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.7.0)
144Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.2.0)
145Requirement already satisfied: dm-tree~=0.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow-model-optimization>=0.4.1->tf-models-official>=2.5.1->object-detection==0.1) (0.1.6)
146Requirement already satisfied: crcmod<2.0,>=1.7 in /usr/local/lib/python3.7/dist-packages (from apache-beam->object-detection==0.1) (1.7)
147Collecting fastavro<2,>=0.21.4
148 Downloading fastavro-1.4.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB)
149 |████████████████████████████████| 2.3 MB 38.1 MB/s
150Requirement already satisfied: pyarrow<7.0.0,>=0.15.1 in /usr/local/lib/python3.7/dist-packages (from apache-beam->object-detection==0.1) (6.0.1)
151Requirement already satisfied: pydot<2,>=1.2.0 in /usr/local/lib/python3.7/dist-packages (from apache-beam->object-detection==0.1) (1.3.0)
152Collecting proto-plus<2,>=1.7.1
153 Downloading proto_plus-1.19.9-py3-none-any.whl (45 kB)
154 |████████████████████████████████| 45 kB 3.2 MB/s
155Collecting requests<3.0.0dev,>=2.18.0
156 Downloading requests-2.27.1-py2.py3-none-any.whl (63 kB)
157 |████████████████████████████████| 63 kB 1.8 MB/s
158Collecting dill<0.3.2,>=0.3.1.1
159 Downloading dill-0.3.1.1.tar.gz (151 kB)
160 |████████████████████████████████| 151 kB 44.4 MB/s
161Collecting numpy>=1.15.4
162 Downloading numpy-1.20.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.3 MB)
163 |████████████████████████████████| 15.3 MB 21.1 MB/s
164Collecting orjson<4.0
165 Downloading orjson-3.6.6-cp37-cp37m-manylinux_2_24_x86_64.whl (245 kB)
166 |████████████████████████████████| 245 kB 53.2 MB/s
167Collecting hdfs<3.0.0,>=2.1.0
168 Downloading hdfs-2.6.0-py3-none-any.whl (33 kB)
169Collecting pymongo<4.0.0,>=3.8.0
170 Downloading pymongo-3.12.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508 kB)
171 |████████████████████████████████| 508 kB 44.3 MB/s
172Requirement already satisfied: docopt in /usr/local/lib/python3.7/dist-packages (from hdfs<3.0.0,>=2.1.0->apache-beam->object-detection==0.1) (0.6.2)
173Collecting protobuf>=3.12.0
174 Downloading protobuf-3.19.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
175 |████████████████████████████████| 1.1 MB 47.3 MB/s
176Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2.0.11)
177Requirement already satisfied: opencv-python>=4.1.0.25 in /usr/local/lib/python3.7/dist-packages (from lvis->object-detection==0.1) (4.1.2.30)
178Requirement already satisfied: cycler>=0.10.0 in /usr/local/lib/python3.7/dist-packages (from lvis->object-detection==0.1) (0.11.0)
179Requirement already satisfied: kiwisolver>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from lvis->object-detection==0.1) (1.3.2)
180Requirement already satisfied: text-unidecode>=1.3 in /usr/local/lib/python3.7/dist-packages (from python-slugify->kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (1.3)
181Requirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from sacrebleu->tf-models-official>=2.5.1->object-detection==0.1) (2019.12.20)
182Requirement already satisfied: tabulate>=0.8.9 in /usr/local/lib/python3.7/dist-packages (from sacrebleu->tf-models-official>=2.5.1->object-detection==0.1) (0.8.9)
183Collecting portalocker
184 Downloading portalocker-2.3.2-py2.py3-none-any.whl (15 kB)
185Collecting colorama
186 Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
187Requirement already satisfied: scikit-learn>=0.21.3 in /usr/local/lib/python3.7/dist-packages (from seqeval->tf-models-official>=2.5.1->object-detection==0.1) (1.0.2)
188Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.21.3->seqeval->tf-models-official>=2.5.1->object-detection==0.1) (1.1.0)
189Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.21.3->seqeval->tf-models-official>=2.5.1->object-detection==0.1) (3.1.0)
190Requirement already satisfied: typeguard>=2.7 in /usr/local/lib/python3.7/dist-packages (from tensorflow-addons->tf-models-official>=2.5.1->object-detection==0.1) (2.7.1)
191Requirement already satisfied: promise in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (2.3)
192Requirement already satisfied: future in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (0.16.0)
193Requirement already satisfied: attrs>=18.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (21.4.0)
194Requirement already satisfied: importlib-resources in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (5.4.0)
195Requirement already satisfied: tensorflow-metadata in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (1.6.0)
196Collecting tensorflow-io-gcs-filesystem>=0.23.1
197 Downloading tensorflow_io_gcs_filesystem-0.24.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.1 MB)
198 |████████████████████████████████| 2.1 MB 40.9 MB/s
199Building wheels for collected packages: object-detection, py-cpuinfo, dill, avro-python3, seqeval
200 Building wheel for object-detection (setup.py) ... done
201 Created wheel for object-detection: filename=object_detection-0.1-py3-none-any.whl size=1686316 sha256=775b8c34c800b3b3139d1067abd686af9ce9158011fccfb5450ccfd9bf424a5a
202 Stored in directory: /tmp/pip-ephem-wheel-cache-rmw0fvil/wheels/d0/e3/e9/b9ffe85019ec441e90d8ff9eddee9950c4c23b7598204390b9
203 Building wheel for py-cpuinfo (setup.py) ... done
204 Created wheel for py-cpuinfo: filename=py_cpuinfo-8.0.0-py3-none-any.whl size=22257 sha256=ac956c4c039868fdba78645bea056754e667e8840bea783ad2ca75e4d3e682c6
205 Stored in directory: /root/.cache/pip/wheels/d2/f1/1f/041add21dc9c4220157f1bd2bd6afe1f1a49524c3396b94401
206 Building wheel for dill (setup.py) ... done
207 Created wheel for dill: filename=dill-0.3.1.1-py3-none-any.whl size=78544 sha256=d9c6cdfd69aea2b4d78e6afbbe2bc530394e4081eb186eb4f4cd02373ca739fd
208 Stored in directory: /root/.cache/pip/wheels/a4/61/fd/c57e374e580aa78a45ed78d5859b3a44436af17e22ca53284f
209 Building wheel for avro-python3 (setup.py) ... done
210 Created wheel for avro-python3: filename=avro_python3-1.10.2-py3-none-any.whl size=44010 sha256=4eca8b4f30e4850d5dabccee36c40c8dda8a6c7e7058cfb7f0258eea5ce7b2b3
211 Stored in directory: /root/.cache/pip/wheels/d6/e5/b1/6b151d9b535ee50aaa6ab27d145a0104b6df02e5636f0376da
212 Building wheel for seqeval (setup.py) ... done
213 Created wheel for seqeval: filename=seqeval-1.2.2-py3-none-any.whl size=16180 sha256=0ddfa46d0e36e9be346a90833ef11cc0d38cc7e744be34c5a0d321f997a30cba
214 Stored in directory: /root/.cache/pip/wheels/05/96/ee/7cac4e74f3b19e3158dce26a20a1c86b3533c43ec72a549fd7
215Successfully built object-detection py-cpuinfo dill avro-python3 seqeval
216Installing collected packages: requests, protobuf, numpy, tf-estimator-nightly, tensorflow-io-gcs-filesystem, tensorboard, keras, tensorflow, portalocker, dill, colorama, tf-slim, tensorflow-text, tensorflow-model-optimization, tensorflow-addons, seqeval, sentencepiece, sacrebleu, pyyaml, pymongo, py-cpuinfo, proto-plus, orjson, opencv-python-headless, hdfs, fastavro, tf-models-official, tensorflow-io, lvis, avro-python3, apache-beam, object-detection
217 Attempting uninstall: requests
218 Found existing installation: requests 2.23.0
219 Uninstalling requests-2.23.0:
220 Successfully uninstalled requests-2.23.0
221 Attempting uninstall: protobuf
222 Found existing installation: protobuf 3.17.3
223 Uninstalling protobuf-3.17.3:
224 Successfully uninstalled protobuf-3.17.3
225 Attempting uninstall: numpy
226 Found existing installation: numpy 1.19.5
227 Uninstalling numpy-1.19.5:
228 Successfully uninstalled numpy-1.19.5
229 Attempting uninstall: tensorflow-io-gcs-filesystem
230 Found existing installation: tensorflow-io-gcs-filesystem 0.23.1
231 Uninstalling tensorflow-io-gcs-filesystem-0.23.1:
232 Successfully uninstalled tensorflow-io-gcs-filesystem-0.23.1
233 Attempting uninstall: tensorboard
234 Found existing installation: tensorboard 2.7.0
235 Uninstalling tensorboard-2.7.0:
236 Successfully uninstalled tensorboard-2.7.0
237 Attempting uninstall: keras
238 Found existing installation: keras 2.7.0
239 Uninstalling keras-2.7.0:
240 Successfully uninstalled keras-2.7.0
241 Attempting uninstall: tensorflow
242 Found existing installation: tensorflow 2.7.0
243 Uninstalling tensorflow-2.7.0:
244 Successfully uninstalled tensorflow-2.7.0
245 Attempting uninstall: dill
246 Found existing installation: dill 0.3.4
247 Uninstalling dill-0.3.4:
248 Successfully uninstalled dill-0.3.4
249 Attempting uninstall: pyyaml
250 Found existing installation: PyYAML 3.13
251 Uninstalling PyYAML-3.13:
252 Successfully uninstalled PyYAML-3.13
253 Attempting uninstall: pymongo
254 Found existing installation: pymongo 4.0.1
255 Uninstalling pymongo-4.0.1:
256 Successfully uninstalled pymongo-4.0.1
257ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
258yellowbrick 1.3.post1 requires numpy<1.20,>=1.16.0, but you have numpy 1.20.3 which is incompatible.
259multiprocess 0.70.12.2 requires dill>=0.3.4, but you have dill 0.3.1.1 which is incompatible.
260google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible.
261datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
262albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
263Successfully installed apache-beam-2.35.0 avro-python3-1.10.2 colorama-0.4.4 dill-0.3.1.1 fastavro-1.4.9 hdfs-2.6.0 keras-2.8.0 lvis-0.5.3 numpy-1.20.3 object-detection-0.1 opencv-python-headless-4.5.5.62 orjson-3.6.6 portalocker-2.3.2 proto-plus-1.19.9 protobuf-3.19.4 py-cpuinfo-8.0.0 pymongo-3.12.3 pyyaml-5.4.1 requests-2.27.1 sacrebleu-2.0.0 sentencepiece-0.1.96 seqeval-1.2.2 tensorboard-2.8.0 tensorflow-2.8.0 tensorflow-addons-0.15.0 tensorflow-io-0.24.0 tensorflow-io-gcs-filesystem-0.24.0 tensorflow-model-optimization-0.7.0 tensorflow-text-2.8.1 tf-estimator-nightly-2.8.0.dev2021122109 tf-models-official-2.8.0 tf-slim-1.1.0
264
I am noticing that this command uninstalling tensorflow 2.7 and installing tensorflow 2.8. I am not sure it was happening before. Maybe it's the reason DNN library link is missing o something?
I can confirm these:
- Nothing was changed inside pretrained model or already installed model or object_detection source files I downloaded a year ago.
- I tried to run command !pip install dnn - not working
- I tried to restart runtime (without disconnecting) - not working
Somebody can help? Thanks.
ANSWER
Answered 2022-Feb-07 at 09:19It happened the same to me last friday. I think it has something to do with Cuda instalation in Google Colab but I don't know exactly the reason
QUESTION
Minikube dashboard ingress
Asked 2022-Feb-05 at 21:52Im trying to make an ingress for the minikube dashboard using the embedded dashboard internal service.
I enabled both ingress
and dashboard
minikube addons.
I also wrote this ingress YAML file :
1apiVersion: networking.k8s.io/v1
2kind: Ingress
3metadata:
4 name: dashboard-ingress
5 namespace: kubernetes-dashboard
6spec:
7 rules:
8 - host: dashboard.com
9 http:
10 paths:
11 - path: /
12 pathType: Prefix
13 backend:
14 service:
15 name: kubernetes-dashboard
16 port:
17 number: 80
18
My Ingress is being created well as u can see :
1apiVersion: networking.k8s.io/v1
2kind: Ingress
3metadata:
4 name: dashboard-ingress
5 namespace: kubernetes-dashboard
6spec:
7 rules:
8 - host: dashboard.com
9 http:
10 paths:
11 - path: /
12 pathType: Prefix
13 backend:
14 service:
15 name: kubernetes-dashboard
16 port:
17 number: 80
18NAME CLASS HOSTS ADDRESS PORTS AGE
19dashboard-ingress nginx dashboard.com localhost 80 15s
20
I edited my /etc/hosts
to add this line : 127.0.0.1 dashboard.com
.
Now im trying to access the dashboard trough dashboard.com
. But it's not working.
kubectl describe ingress dashboard-ingress -n kubernetes-dashboard
gives me this :
1apiVersion: networking.k8s.io/v1
2kind: Ingress
3metadata:
4 name: dashboard-ingress
5 namespace: kubernetes-dashboard
6spec:
7 rules:
8 - host: dashboard.com
9 http:
10 paths:
11 - path: /
12 pathType: Prefix
13 backend:
14 service:
15 name: kubernetes-dashboard
16 port:
17 number: 80
18NAME CLASS HOSTS ADDRESS PORTS AGE
19dashboard-ingress nginx dashboard.com localhost 80 15s
20Name: dashboard-ingress
21Namespace: kubernetes-dashboard
22Address: localhost
23Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
24Rules:
25 Host Path Backends
26 ---- ---- --------
27 dashboard.com
28 / kubernetes-dashboard:80 (172.17.0.4:9090)
29Annotations: <none>
30Events:
31 Type Reason Age From Message
32 ---- ------ ---- ---- -------
33 Normal Sync 14m (x2 over 14m) nginx-ingress-controller Scheduled for sync
34
I don't really understand what <error: endpoints "default-http-backend" not found>
means, but maybe my issue comes from this.
kubectl get pods -n ingress-nginx
result :
1apiVersion: networking.k8s.io/v1
2kind: Ingress
3metadata:
4 name: dashboard-ingress
5 namespace: kubernetes-dashboard
6spec:
7 rules:
8 - host: dashboard.com
9 http:
10 paths:
11 - path: /
12 pathType: Prefix
13 backend:
14 service:
15 name: kubernetes-dashboard
16 port:
17 number: 80
18NAME CLASS HOSTS ADDRESS PORTS AGE
19dashboard-ingress nginx dashboard.com localhost 80 15s
20Name: dashboard-ingress
21Namespace: kubernetes-dashboard
22Address: localhost
23Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
24Rules:
25 Host Path Backends
26 ---- ---- --------
27 dashboard.com
28 / kubernetes-dashboard:80 (172.17.0.4:9090)
29Annotations: <none>
30Events:
31 Type Reason Age From Message
32 ---- ------ ---- ---- -------
33 Normal Sync 14m (x2 over 14m) nginx-ingress-controller Scheduled for sync
34NAME READY STATUS RESTARTS AGE
35ingress-nginx-admission-create--1-8krc7 0/1 Completed 0 100m
36ingress-nginx-admission-patch--1-qblch 0/1 Completed 1 100m
37ingress-nginx-controller-5f66978484-hvk9j 1/1 Running 0 100m
38
Logs for nginx-controller pod :
1apiVersion: networking.k8s.io/v1
2kind: Ingress
3metadata:
4 name: dashboard-ingress
5 namespace: kubernetes-dashboard
6spec:
7 rules:
8 - host: dashboard.com
9 http:
10 paths:
11 - path: /
12 pathType: Prefix
13 backend:
14 service:
15 name: kubernetes-dashboard
16 port:
17 number: 80
18NAME CLASS HOSTS ADDRESS PORTS AGE
19dashboard-ingress nginx dashboard.com localhost 80 15s
20Name: dashboard-ingress
21Namespace: kubernetes-dashboard
22Address: localhost
23Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
24Rules:
25 Host Path Backends
26 ---- ---- --------
27 dashboard.com
28 / kubernetes-dashboard:80 (172.17.0.4:9090)
29Annotations: <none>
30Events:
31 Type Reason Age From Message
32 ---- ------ ---- ---- -------
33 Normal Sync 14m (x2 over 14m) nginx-ingress-controller Scheduled for sync
34NAME READY STATUS RESTARTS AGE
35ingress-nginx-admission-create--1-8krc7 0/1 Completed 0 100m
36ingress-nginx-admission-patch--1-qblch 0/1 Completed 1 100m
37ingress-nginx-controller-5f66978484-hvk9j 1/1 Running 0 100m
38-------------------------------------------------------------------------------
39NGINX Ingress controller
40 Release: v1.0.4
41 Build: 9b78b6c197b48116243922170875af4aa752ee59
42 Repository: https://github.com/kubernetes/ingress-nginx
43 nginx version: nginx/1.19.9
44
45-------------------------------------------------------------------------------
46
47W1205 19:33:42.303136 7 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
48I1205 19:33:42.303261 7 main.go:221] "Creating API client" host="https://10.96.0.1:443"
49I1205 19:33:42.319750 7 main.go:265] "Running in Kubernetes cluster" major="1" minor="22" git="v1.22.3" state="clean" commit="c92036820499fedefec0f847e2054d824aea6cd1" platform="linux/amd64"
50I1205 19:33:42.402223 7 main.go:104] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem"
51I1205 19:33:42.413477 7 ssl.go:531] "loading tls certificate" path="/usr/local/certificates/cert" key="/usr/local/certificates/key"
52I1205 19:33:42.420838 7 nginx.go:253] "Starting NGINX Ingress controller"
53I1205 19:33:42.424731 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"ingress-nginx-controller", UID:"f2d27cc7-b103-490f-807f-18ccaa614e6b", APIVersion:"v1", ResourceVersion:"664", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/ingress-nginx-controller
54I1205 19:33:42.427171 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"tcp-services", UID:"e174971d-df1c-4826-85d4-194598ab1912", APIVersion:"v1", ResourceVersion:"665", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/tcp-services
55I1205 19:33:42.427195 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"udp-services", UID:"0ffc7ee9-2435-4005-983d-ed41aac1c9aa", APIVersion:"v1", ResourceVersion:"666", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/udp-services
56I1205 19:33:43.622661 7 nginx.go:295] "Starting NGINX process"
57I1205 19:33:43.622746 7 leaderelection.go:243] attempting to acquire leader lease ingress-nginx/ingress-controller-leader...
58I1205 19:33:43.623402 7 nginx.go:315] "Starting validation webhook" address=":8443" certPath="/usr/local/certificates/cert" keyPath="/usr/local/certificates/key"
59I1205 19:33:43.623683 7 controller.go:152] "Configuration changes detected, backend reload required"
60I1205 19:33:43.643547 7 leaderelection.go:253] successfully acquired lease ingress-nginx/ingress-controller-leader
61I1205 19:33:43.643635 7 status.go:84] "New leader elected" identity="ingress-nginx-controller-5f66978484-hvk9j"
62I1205 19:33:43.691342 7 controller.go:169] "Backend successfully reloaded"
63I1205 19:33:43.691395 7 controller.go:180] "Initial sync, sleeping for 1 second"
64I1205 19:33:43.691435 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-nginx", Name:"ingress-nginx-controller-5f66978484-hvk9j", UID:"55d45c26-eda7-4b37-9b04-5491cde39fd4", APIVersion:"v1", ResourceVersion:"697", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
65I1205 21:06:47.402756 7 main.go:101] "successfully validated configuration, accepting" ingress="dashboard-ingress/kubernetes-dashboard"
66I1205 21:06:47.408929 7 store.go:371] "Found valid IngressClass" ingress="kubernetes-dashboard/dashboard-ingress" ingressclass="nginx"
67I1205 21:06:47.409343 7 controller.go:152] "Configuration changes detected, backend reload required"
68I1205 21:06:47.409352 7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"dashboard-ingress", UID:"be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3", APIVersion:"networking.k8s.io/v1", ResourceVersion:"5529", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
69I1205 21:06:47.458273 7 controller.go:169] "Backend successfully reloaded"
70I1205 21:06:47.458445 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-nginx", Name:"ingress-nginx-controller-5f66978484-hvk9j", UID:"55d45c26-eda7-4b37-9b04-5491cde39fd4", APIVersion:"v1", ResourceVersion:"697", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
71I1205 21:07:43.654037 7 status.go:300] "updating Ingress status" namespace="kubernetes-dashboard" ingress="dashboard-ingress" currentValue=[] newValue=[{IP: Hostname:localhost Ports:[]}]
72I1205 21:07:43.660598 7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"dashboard-ingress", UID:"be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3", APIVersion:"networking.k8s.io/v1", ResourceVersion:"5576", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
73
Anyone has a clue on how i can solve my problem ?
(Im using minikube v1.24.0)
Regards,
ANSWER
Answered 2021-Dec-13 at 11:10I had similar issues with Minikube's Ingress, but I was using Windows.
After indepth search, I discovered that the problem came from Docker's driver.
I changed the driver to VirtualBox and Ingress started behaving as expected.
This entry provides further details.
QUESTION
NPM CI error bindings not accessible from watchpack-chokidar2:fsevents
Asked 2022-Feb-02 at 12:53When I run npm ci
on Github Actions I got the error:
1Run npm ci
2npm ERR! bindings not accessible from watchpack-chokidar2:fsevents
3
4npm ERR! A complete log of this run can be found in:
5npm ERR! /home/runner/.npm/_logs/2021-09-17T15_18_42_465Z-debug.log
6Error: Process completed with exit code 1.
7
What can be?
My .github/workflows/eslint.yaml
1Run npm ci
2npm ERR! bindings not accessible from watchpack-chokidar2:fsevents
3
4npm ERR! A complete log of this run can be found in:
5npm ERR! /home/runner/.npm/_logs/2021-09-17T15_18_42_465Z-debug.log
6Error: Process completed with exit code 1.
7name: ESLint
8
9on: [push, pull_request]
10
11jobs:
12 build:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v2
16 - name: Use Node.js
17 uses: actions/setup-node@v1
18 with:
19 node-version: '14.x'
20 - run: npm ci
21 - run: npm run lint
22
My package.json
1Run npm ci
2npm ERR! bindings not accessible from watchpack-chokidar2:fsevents
3
4npm ERR! A complete log of this run can be found in:
5npm ERR! /home/runner/.npm/_logs/2021-09-17T15_18_42_465Z-debug.log
6Error: Process completed with exit code 1.
7name: ESLint
8
9on: [push, pull_request]
10
11jobs:
12 build:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v2
16 - name: Use Node.js
17 uses: actions/setup-node@v1
18 with:
19 node-version: '14.x'
20 - run: npm ci
21 - run: npm run lint
22{
23 "name": "@blinktrade/uikit",
24 "version": "1.0.0",
25 "main": "dist/index.js",
26 "license": "MIT",
27 "devDependencies": {
28 "@babel/plugin-transform-react-jsx": "^7.14.9",
29 "@babel/preset-env": "^7.15.6",
30 "@babel/preset-react": "^7.14.5",
31 "@babel/preset-typescript": "^7.15.0",
32 "@storybook/addon-essentials": "^6.3.8",
33 "@storybook/react": "^6.3.8",
34 "@testing-library/jest-dom": "^5.14.1",
35 "@testing-library/react": "^12.1.0",
36 "@testing-library/user-event": "^13.2.1",
37 "@types/jest": "^27.0.1",
38 "@types/react": "^17.0.21",
39 "@typescript-eslint/eslint-plugin": "^4.31.1",
40 "@typescript-eslint/parser": "^4.31.1",
41 "eslint": "^7.32.0",
42 "eslint-plugin-react": "^7.25.2",
43 "husky": "^7.0.2",
44 "jest": "^27.2.0",
45 "prettier": "^2.4.1",
46 "pretty-quick": "^3.1.1",
47 "react": "^17.0.2",
48 "react-dom": "^17.0.2",
49 "rimraf": "^3.0.2",
50 "typescript": "^4.4.3"
51 },
52 "husky": {
53 "hooks": {
54 "pre-push": "npm run lint",
55 "pre-commit": "pretty-quick --staged"
56 }
57 },
58 "scripts": {
59 "build": "tsc -p .",
60 "clear": "rimraf dist/",
61 "format": "prettier '**/*' --write --ignore-unknown",
62 "lint": "eslint --max-warnings=0 .",
63 "storybook": "start-storybook -p 4000",
64 "test": "jest"
65 }
66}
67
ANSWER
Answered 2021-Sep-20 at 20:57Solved removing packages-lock.json and running again using NodeJS 14 (was 10)
QUESTION
What should the result be when assigning a variable to a reference to itself, in-between modified and then returned by a function call?
Asked 2022-Feb-02 at 00:421#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15
I'm currently in the middle of learning about lvalues and rvalues and was experimenting a bit, and made this which seems to be getting conflicting results. https://godbolt.org/z/KqsGz3Toe produces an out put of "5 6", as does Clion and Visual Studio, however https://www.onlinegdb.com/49mUC7x8U produces a result of "6 7"
I would think that because addOne
is calling x
as a reference, it would explicitly change the value of x
to 6 despite being called as an lvalue. What should the correct result be?
ANSWER
Answered 2022-Feb-02 at 00:42Since C++17 the order of evaluation is specified such that the operands of =
are evaluated right-to-left and those of <<
are evaluated left-to-right, matching the associativity of these operators. (But this doesn't apply to all operators, e.g. +
and other arithmetic operators.)
So in
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16
first the value of the right-hand side is evaluated, yielding 5
. Then the function addOne
is called and it doesn't matter what it does with x
since it returns a reference to it, to which the right-hand value 5
is assigned.
Formally, evaluating the right-hand side first means that we replace the lvalue x
by the (pr)value it holds (lvalue-to-rvalue conversion). Then we call addOne(x)
to modify the object that the lvalue x
refers to.
So, imagining temporary variables to hold the results of the individual evaluations, the line is equivalent to (except for extra copies introduced by the new variables, which don't matter in the case of int
):
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19
Then in the line
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout << x << ' ' << addOne(x);
20
we first evaluate and output x
, resulting in 5
, and then call addOne
, resulting in 6
.
So the line is equivalent to (simplified, knowing that operator<<
will return std::cout
again):
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout << x << ' ' << addOne(x);
20int t1 = x;
21std::cout << t1 << ' ';
22int t2 = addOne(x);
23std::cout << t2;
24
The output 5 6
is the only correct one since C++17.
Before C++17, the evaluation order of the two sides of the assignment operator was unsequenced.
Having a scalar modification unsequenced with a value computation on the same scalar (on the right-hand side of your assignment) causes undefined behavior normally.
But since you put the increment of x
into a function, an additional rule saying that the execution of a function body is merely indeterminately sequenced with other evaluations in the calling context saves this. It means that the line wont have undefined behavior anymore, but the order in which the evaluations of the two sides of the assignment happen could be either left-first or right-first.
This means we won't know whether x
is evaluated first and then addOne(x)
or the other way around.
Therefore after the line, x
may be 5
or 6
.
6
would be obtained if the evaluation happened equivalently to
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout << x << ' ' << addOne(x);
20int t1 = x;
21std::cout << t1 << ' ';
22int t2 = addOne(x);
23std::cout << t2;
24int& y = addOne(x);
25int t = x;
26y = t;
27
Then in the line
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout << x << ' ' << addOne(x);
20int t1 = x;
21std::cout << t1 << ' ';
22int t2 = addOne(x);
23std::cout << t2;
24int& y = addOne(x);
25int t = x;
26y = t;
27std::cout << x << ' ' << addOne(x);
28
pre-C++17 the same issue applied. The evaluations of the arguments to <<
were indeterminately sequenced, rather than left-to-right and so addOne(x)
could be evaluated before the left-hand x
, i.e. in addition to the previous order, the evaluation could also be equivalent to
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout << x << ' ' << addOne(x);
20int t1 = x;
21std::cout << t1 << ' ';
22int t2 = addOne(x);
23std::cout << t2;
24int& y = addOne(x);
25int t = x;
26y = t;
27std::cout << x << ' ' << addOne(x);
28int t2 = addOne(x);
29int t1 = x;
30std::cout << t1 << ' ' << t2;
31
In this case x
is first incremented and then its new value is printed twice.
Therefore possible program output could be either of the following:
1#include <iostream>
2
3int& addOne(int& x)
4{
5 x += 1;
6 return x;
7}
8
9int main()
10{
11 int x {5};
12 addOne(x) = x;
13 std::cout << x << ' ' << addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int& y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout << x << ' ' << addOne(x);
20int t1 = x;
21std::cout << t1 << ' ';
22int t2 = addOne(x);
23std::cout << t2;
24int& y = addOne(x);
25int t = x;
26y = t;
27std::cout << x << ' ' << addOne(x);
28int t2 = addOne(x);
29int t1 = x;
30std::cout << t1 << ' ' << t2;
315 6
326 6
336 7
347 7
35
(Technically the int t2 = addOne(x)
are two evaluations: One call to addOne
returning a reference and then the lvalue-to-rvalue conversion. These could happen interleaved with the other evaluations, but this doesn't give any new program outputs.)
You can specify to use C++17 (or newer versions like C++20) with the -std=c++17
flag to the compiler if you are using GCC or Clang and /std:c++17
if you are using MSVC. Which standard version is chosen by-default depends on the compiler and compiler version.
QUESTION
How to penetrate or cut holes through a 2D foreground
Asked 2022-Jan-22 at 03:11I'm currently making a 2D game in Javascript, but I want to the game to have different lighting levels, for example, if I were to create a day and night cycle. However, I want to be able to cut holes in the lighting/foreground, or do something so that I can make certain parts of the screen lit up, for example like a flashlight or candle. Note: I'm also using the P5.js library.
The most obvious idea that came to mind for going about in creating a foreground is just creating a rectangle with some opacity that covers the entire screen. This is good, but how am I supposed cut through this? Obviously, the code below won't work because I'm just layering on another element, and the rectangle is still obstructed and not perfectly clear.
1function setup() {
2 noStroke();
3 createCanvas(400, 400);
4}
5
6function draw() {
7 background(255); //white
8
9 fill(255, 0, 0);
10 rect(200, 200, 25, 25); //Example object
11
12 fill(150, 150, 150, 100); //Gray with opacity
13 rect(0, 0, 400, 400); //Darkness covering entire screen, foreground
14
15 fill(255, 255, 255, 100)
16 ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
17}
1function setup() {
2 noStroke();
3 createCanvas(400, 400);
4}
5
6function draw() {
7 background(255); //white
8
9 fill(255, 0, 0);
10 rect(200, 200, 25, 25); //Example object
11
12 fill(150, 150, 150, 100); //Gray with opacity
13 rect(0, 0, 400, 400); //Darkness covering entire screen, foreground
14
15 fill(255, 255, 255, 100)
16 ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
17}<!DOCTYPE html>
18<html lang="en">
19 <head>
20 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
21 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
22 <link rel="stylesheet" type="text/css" href="style.css">
23 <meta charset="utf-8" />
24
25 </head>
26 <body>
27 <script src="sketch.js"></script>
28 </body>
29</html>
How would I go about doing this? I want this to work not only with just a plain background and simple shapes, but with images as well. Is there a way to cut holes in shapes, or do I need to use something else, like a shader or mask?
Thanks.
ANSWER
Answered 2022-Jan-22 at 03:11The erase()
function may be what you are looking for. It is more flexible than trying to explicitly paint over the areas you want to cover (such as in the approach of using the stroke of a circle and rectangle to cover everything except a circle). And it is easier to use than beginContour()
since you can use it with any of the built in drawing primitives (rect, ellipse, triangle, etc).
1function setup() {
2 noStroke();
3 createCanvas(400, 400);
4}
5
6function draw() {
7 background(255); //white
8
9 fill(255, 0, 0);
10 rect(200, 200, 25, 25); //Example object
11
12 fill(150, 150, 150, 100); //Gray with opacity
13 rect(0, 0, 400, 400); //Darkness covering entire screen, foreground
14
15 fill(255, 255, 255, 100)
16 ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
17}<!DOCTYPE html>
18<html lang="en">
19 <head>
20 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
21 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
22 <link rel="stylesheet" type="text/css" href="style.css">
23 <meta charset="utf-8" />
24
25 </head>
26 <body>
27 <script src="sketch.js"></script>
28 </body>
29</html>let overlay;
30
31function setup() {
32 noStroke();
33 createCanvas(windowWidth, windowHeight);
34 overlay = createGraphics(width, height);
35 overlay.noStroke();
36 overlay.fill(255);
37 overlay.background(150, 150, 150, 200);
38}
39
40function mouseMoved() {
41 // Only update the overlay when something changes
42 // Clear the overlay so that alpha doesn't accumulate
43 overlay.clear()
44 //Gray with opacity, covering entire screen, foreground
45 overlay.background(150, 150, 150, 200);
46
47 // The color and alpha values for shapes drawn when erasing basically do not matter. You can effect the % of erasure with the arguments erase.
48 overlay.erase(100);
49 overlay.ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
50 overlay.noErase();
51}
52
53function draw() {
54 background(255); //white
55
56 fill(255, 0, 0);
57 rect(width / 2, height / 2, 25, 25); //Example object
58
59 image(overlay, 0, 0, width, height);
60}
1function setup() {
2 noStroke();
3 createCanvas(400, 400);
4}
5
6function draw() {
7 background(255); //white
8
9 fill(255, 0, 0);
10 rect(200, 200, 25, 25); //Example object
11
12 fill(150, 150, 150, 100); //Gray with opacity
13 rect(0, 0, 400, 400); //Darkness covering entire screen, foreground
14
15 fill(255, 255, 255, 100)
16 ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
17}<!DOCTYPE html>
18<html lang="en">
19 <head>
20 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
21 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
22 <link rel="stylesheet" type="text/css" href="style.css">
23 <meta charset="utf-8" />
24
25 </head>
26 <body>
27 <script src="sketch.js"></script>
28 </body>
29</html>let overlay;
30
31function setup() {
32 noStroke();
33 createCanvas(windowWidth, windowHeight);
34 overlay = createGraphics(width, height);
35 overlay.noStroke();
36 overlay.fill(255);
37 overlay.background(150, 150, 150, 200);
38}
39
40function mouseMoved() {
41 // Only update the overlay when something changes
42 // Clear the overlay so that alpha doesn't accumulate
43 overlay.clear()
44 //Gray with opacity, covering entire screen, foreground
45 overlay.background(150, 150, 150, 200);
46
47 // The color and alpha values for shapes drawn when erasing basically do not matter. You can effect the % of erasure with the arguments erase.
48 overlay.erase(100);
49 overlay.ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
50 overlay.noErase();
51}
52
53function draw() {
54 background(255); //white
55
56 fill(255, 0, 0);
57 rect(width / 2, height / 2, 25, 25); //Example object
58
59 image(overlay, 0, 0, width, height);
60}<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
If you want to remove shapes from your overlay with more complete alpha channel support you can use blendMode(ERASE)
.
1function setup() {
2 noStroke();
3 createCanvas(400, 400);
4}
5
6function draw() {
7 background(255); //white
8
9 fill(255, 0, 0);
10 rect(200, 200, 25, 25); //Example object
11
12 fill(150, 150, 150, 100); //Gray with opacity
13 rect(0, 0, 400, 400); //Darkness covering entire screen, foreground
14
15 fill(255, 255, 255, 100)
16 ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
17}<!DOCTYPE html>
18<html lang="en">
19 <head>
20 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
21 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
22 <link rel="stylesheet" type="text/css" href="style.css">
23 <meta charset="utf-8" />
24
25 </head>
26 <body>
27 <script src="sketch.js"></script>
28 </body>
29</html>let overlay;
30
31function setup() {
32 noStroke();
33 createCanvas(windowWidth, windowHeight);
34 overlay = createGraphics(width, height);
35 overlay.noStroke();
36 overlay.fill(255);
37 overlay.background(150, 150, 150, 200);
38}
39
40function mouseMoved() {
41 // Only update the overlay when something changes
42 // Clear the overlay so that alpha doesn't accumulate
43 overlay.clear()
44 //Gray with opacity, covering entire screen, foreground
45 overlay.background(150, 150, 150, 200);
46
47 // The color and alpha values for shapes drawn when erasing basically do not matter. You can effect the % of erasure with the arguments erase.
48 overlay.erase(100);
49 overlay.ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
50 overlay.noErase();
51}
52
53function draw() {
54 background(255); //white
55
56 fill(255, 0, 0);
57 rect(width / 2, height / 2, 25, 25); //Example object
58
59 image(overlay, 0, 0, width, height);
60}<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>let overlay;
61let overlayCtx;
62
63let gradient;
64
65function setup() {
66 noStroke();
67 createCanvas(windowWidth, windowHeight);
68 overlay = createGraphics(width, height);
69 overlayCtx = overlay.drawingContext;
70 overlay.noStroke();
71 overlay.background(150, 150, 150, 200);
72
73 // Using the raw canvas API to make a radial gradient
74 gradient = overlayCtx.createRadialGradient(0, 0, 5, 0, 0, 25);
75 // The colors here don't matter, only the alpha channel
76 gradient.addColorStop(0, 'rgba(0,0,0,1)');
77 gradient.addColorStop(1, 'rgba(0,0,0,0)');
78 overlayCtx.fillStyle = gradient;
79}
80
81function mouseMoved() {
82 // Only update the overlay when something changes
83 // Clear the overlay so that alpha doesn't accumulate
84 overlay.clear()
85 //Gray with opacity, covering entire screen, foreground
86 overlay.background(150, 150, 150, 200);
87
88 overlay.push();
89 // Use blend mode REMOVE to remove the color (using only the alpha channel?)
90 overlay.blendMode(REMOVE);
91 // Because of the way gradients work we have to translate and draw our ellipse at the origin.
92 overlay.translate(mouseX, mouseY);
93 overlay.ellipse(0, 0, 50, 50); //object that is supposed to penetrate foreground.
94 overlay.blendMode(BLEND);
95 overlay.pop();
96}
97
98function draw() {
99 background(255); //white
100
101 fill(255, 0, 0);
102 rect(width / 2, height / 2, 25, 25); //Example object
103
104 image(overlay, 0, 0, width, height);
105}
1function setup() {
2 noStroke();
3 createCanvas(400, 400);
4}
5
6function draw() {
7 background(255); //white
8
9 fill(255, 0, 0);
10 rect(200, 200, 25, 25); //Example object
11
12 fill(150, 150, 150, 100); //Gray with opacity
13 rect(0, 0, 400, 400); //Darkness covering entire screen, foreground
14
15 fill(255, 255, 255, 100)
16 ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
17}<!DOCTYPE html>
18<html lang="en">
19 <head>
20 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
21 <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
22 <link rel="stylesheet" type="text/css" href="style.css">
23 <meta charset="utf-8" />
24
25 </head>
26 <body>
27 <script src="sketch.js"></script>
28 </body>
29</html>let overlay;
30
31function setup() {
32 noStroke();
33 createCanvas(windowWidth, windowHeight);
34 overlay = createGraphics(width, height);
35 overlay.noStroke();
36 overlay.fill(255);
37 overlay.background(150, 150, 150, 200);
38}
39
40function mouseMoved() {
41 // Only update the overlay when something changes
42 // Clear the overlay so that alpha doesn't accumulate
43 overlay.clear()
44 //Gray with opacity, covering entire screen, foreground
45 overlay.background(150, 150, 150, 200);
46
47 // The color and alpha values for shapes drawn when erasing basically do not matter. You can effect the % of erasure with the arguments erase.
48 overlay.erase(100);
49 overlay.ellipse(mouseX, mouseY, 50, 50); //object that is supposed to penetrate foreground.
50 overlay.noErase();
51}
52
53function draw() {
54 background(255); //white
55
56 fill(255, 0, 0);
57 rect(width / 2, height / 2, 25, 25); //Example object
58
59 image(overlay, 0, 0, width, height);
60}<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>let overlay;
61let overlayCtx;
62
63let gradient;
64
65function setup() {
66 noStroke();
67 createCanvas(windowWidth, windowHeight);
68 overlay = createGraphics(width, height);
69 overlayCtx = overlay.drawingContext;
70 overlay.noStroke();
71 overlay.background(150, 150, 150, 200);
72
73 // Using the raw canvas API to make a radial gradient
74 gradient = overlayCtx.createRadialGradient(0, 0, 5, 0, 0, 25);
75 // The colors here don't matter, only the alpha channel
76 gradient.addColorStop(0, 'rgba(0,0,0,1)');
77 gradient.addColorStop(1, 'rgba(0,0,0,0)');
78 overlayCtx.fillStyle = gradient;
79}
80
81function mouseMoved() {
82 // Only update the overlay when something changes
83 // Clear the overlay so that alpha doesn't accumulate
84 overlay.clear()
85 //Gray with opacity, covering entire screen, foreground
86 overlay.background(150, 150, 150, 200);
87
88 overlay.push();
89 // Use blend mode REMOVE to remove the color (using only the alpha channel?)
90 overlay.blendMode(REMOVE);
91 // Because of the way gradients work we have to translate and draw our ellipse at the origin.
92 overlay.translate(mouseX, mouseY);
93 overlay.ellipse(0, 0, 50, 50); //object that is supposed to penetrate foreground.
94 overlay.blendMode(BLEND);
95 overlay.pop();
96}
97
98function draw() {
99 background(255); //white
100
101 fill(255, 0, 0);
102 rect(width / 2, height / 2, 25, 25); //Example object
103
104 image(overlay, 0, 0, width, height);
105}<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
QUESTION
Linking local Openssl to Nodejs C++ addon
Asked 2022-Jan-09 at 23:32I am writing a C++ addon for Nodejs which uses OpenSSL 3 and I keep getting this error when trying to compile the code with the command node-gyp build
:
/Users/myuser/Library/Caches/node-gyp/17.0.1/include/node/openssl/macros.h:155:4: error: "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
I can see that the OpenSSL used here is included from the NodeJS folder, is there any way to link the OpenSSL library I installed with homebrew on my mac M1?
My binding.gyp file looks like this:
1{
2 "targets": [
3 {
4 "target_name": "module",
5 "include_dirs": [ "/opt/homebrew/opt/openssl@3/include" ],
6 "sources": [ "./module.cpp" ],
7 "libraries": [
8 "/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib",
9 "/opt/homebrew/opt/openssl@3/lib/libcrypto.a",
10 "/opt/homebrew/opt/openssl@3/lib/libcrypto.dylib"
11 ]
12 }
13 ]
14}
15
ANSWER
Answered 2022-Jan-09 at 23:32This is a problem in Node.js: https://github.com/nodejs/node/issues/40575
And here is a workaround: https://github.com/mmomtchev/node-gdal-async/commit/85816cbeff104b5484aae840fe43661c16cb6032
Add those two defines to your gyp:
1{
2 "targets": [
3 {
4 "target_name": "module",
5 "include_dirs": [ "/opt/homebrew/opt/openssl@3/include" ],
6 "sources": [ "./module.cpp" ],
7 "libraries": [
8 "/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib",
9 "/opt/homebrew/opt/openssl@3/lib/libcrypto.a",
10 "/opt/homebrew/opt/openssl@3/lib/libcrypto.dylib"
11 ]
12 }
13 ]
14}
15"OPENSSL_API_COMPAT=0x10100001L",
16"OPENSSL_CONFIGURED_API=0x30000000L"
17
I am the author of both the issue and the workaround.
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in Addon
Tutorials and Learning Resources are not available at this moment for Addon