Explore all Addon open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Addon

anki

ember-cli

Release 4.4.0-beta.1

trojan

v2.13.3

data

treestyletab

Popular Libraries in Addon

anki

by ankitects doticonpythondoticon

star image 10864 doticonNOASSERTION

Anki for desktop computers

ember-cli

by ember-cli doticonjavascriptdoticon

star image 3314 doticonMIT

The Ember.js command line utility

trojan

by Jrohy doticongodoticon

star image 3095 doticonGPL-3.0

trojan多用户管理部署程序, 支持web页面管理

data

by emberjs doticonjavascriptdoticon

star image 2996 doticonNOASSERTION

A data persistence library for Ember.js.

webextensions-examples

by mdn doticonjavascriptdoticon

star image 2934 doticonMPL-2.0

Example Firefox add-ons created using the WebExtensions API

treestyletab

by piroor doticonjavascriptdoticon

star image 2522 doticonNOASSERTION

Tree Style Tab, Show tabs like a tree.

django-bootstrap3

by zostera doticonpythondoticon

star image 2278 doticonBSD-3-Clause

Bootstrap 3 integration with Django.

greasemonkey

by greasemonkey doticonjavascriptdoticon

star image 1905 doticonNOASSERTION

Greasemonkey is a user script manager for Firefox.

Universal-Bypass

by Sainan doticonjavascriptdoticon

star image 1540 doticonUnlicense

Don't waste your time with compliance. Universal Bypass circumvents annoying link shorteners.

Trending New libraries in Addon

trojan

by Jrohy doticongodoticon

star image 3095 doticonGPL-3.0

trojan多用户管理部署程序, 支持web页面管理

mixer

by ubisoft doticonpythondoticon

star image 1137 doticonGPL-3.0

Add-on for real-time collaboration in Blender.

ajour

by ajour doticonrustdoticon

star image 875 doticonMIT

A World of Warcraft addon manager written in Rust.

jmesh-tools

by jayanam doticonpythondoticon

star image 363 doticonGPL-3.0

Blender 2.8/2.9 mesh and hard surface utilities addon

browser-desktop

by dothq doticontypescriptdoticon

star image 270 doticonMPL-2.0

Dot Browser for Desktop

slick-fox

by Etesam913 doticoncssdoticon

star image 230 doticonMPL-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.

glslTexture

by patriciogonzalezvivo doticonpythondoticon

star image 215 doticonBSD-3-Clause

Blender addon to create 2D textures from GLSL. It follows the same nomenclature that glslViewer, glslCanvas, glslEditor, ofxShader and PixelSpirit

Miku_Miku_Rig

by 958261649 doticonpythondoticon

star image 206 doticon

MikuMikuRig是一款集生成控制器,自动导入动画,自动布料为一体的blender插件

2anki.net

by alemayhu doticontypescriptdoticon

star image 180 doticonNOASSERTION

Create Anki flashcards faster, easier and better today ⭐️

Top Authors in Addon

1

FriendsOfREDAXO

116 Libraries

star icon3168

2

mike-north

28 Libraries

star icon1037

3

piroor

24 Libraries

star icon2819

4

mozilla

23 Libraries

star icon2729

5

ember-cli

21 Libraries

star icon4577

6

lifeart

21 Libraries

star icon322

7

Pullusb

18 Libraries

star icon157

8

toranb

17 Libraries

star icon272

9

alexlafroscia

17 Libraries

star icon238

10

emberjs

17 Libraries

star icon5401

1

116 Libraries

star icon3168

2

28 Libraries

star icon1037

3

24 Libraries

star icon2819

4

23 Libraries

star icon2729

5

21 Libraries

star icon4577

6

21 Libraries

star icon322

7

18 Libraries

star icon157

8

17 Libraries

star icon272

9

17 Libraries

star icon238

10

17 Libraries

star icon5401

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:26

I 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     &lt;none&gt;        443/TCP    23m
19kube-system   service/metrics-server              ClusterIP   10.152.183.81    &lt;none&gt;        443/TCP    22m
20kube-system   service/kubernetes-dashboard        ClusterIP   10.152.183.103   &lt;none&gt;        443/TCP    22m
21kube-system   service/dashboard-metrics-scraper   ClusterIP   10.152.183.197   &lt;none&gt;        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           &lt;none&gt;                   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: &quot;HTTPS&quot;
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 &quot;ingress.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;extensions/v1beta1&quot;
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] &quot;GET /dashboard HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36&quot; 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:29
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     &lt;none&gt;        443/TCP    23m
19kube-system   service/metrics-server              ClusterIP   10.152.183.81    &lt;none&gt;        443/TCP    22m
20kube-system   service/kubernetes-dashboard        ClusterIP   10.152.183.103   &lt;none&gt;        443/TCP    22m
21kube-system   service/dashboard-metrics-scraper   ClusterIP   10.152.183.197   &lt;none&gt;        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           &lt;none&gt;                   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: &quot;HTTPS&quot;
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 &quot;ingress.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;extensions/v1beta1&quot;
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] &quot;GET /dashboard HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36&quot; 466 0.002 [kube-system-kubernetes-dashboard-443] [] 10.1.76.3:8443 48 0.000 400 ca0946230759edfbaaf9d94f3d5c959a
76error: unable to recognize &quot;ingress.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;extensions/v1beta1&quot;
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     &lt;none&gt;        443/TCP    23m
19kube-system   service/metrics-server              ClusterIP   10.152.183.81    &lt;none&gt;        443/TCP    22m
20kube-system   service/kubernetes-dashboard        ClusterIP   10.152.183.103   &lt;none&gt;        443/TCP    22m
21kube-system   service/dashboard-metrics-scraper   ClusterIP   10.152.183.197   &lt;none&gt;        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           &lt;none&gt;                   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: &quot;HTTPS&quot;
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 &quot;ingress.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;extensions/v1beta1&quot;
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] &quot;GET /dashboard HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36&quot; 466 0.002 [kube-system-kubernetes-dashboard-443] [] 10.1.76.3:8443 48 0.000 400 ca0946230759edfbaaf9d94f3d5c959a
76error: unable to recognize &quot;ingress.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;extensions/v1beta1&quot;
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

Source https://stackoverflow.com/questions/69517855

QUESTION

Type Error: this.getOptions is not a function For style-loader

Asked 2022-Feb-17 at 23:50

Problem

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&quot;@storybook/preset-scss&quot;: &quot;^1.0.3&quot;,
4&quot;css-loader&quot;: &quot;^6.2.0&quot;,
5&quot;sass-loader&quot;: &quot;^10.1.1&quot;,
6&quot;style-loader&quot;: &quot;^3.2.1&quot;
7

Thanks ahead of time!

ANSWER

Answered 2021-Jul-29 at 17:17

Solution

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 to 2.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 to 5.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.

Source https://stackoverflow.com/questions/68580273

QUESTION

Global SCSS style is no longer loaded in Storybook with Angular 12

Asked 2022-Feb-14 at 10:46

I 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 }) =&gt; {
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 }) =&gt; {
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 &quot;{&quot;.
10111 │ import api from &quot;!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js&quot;;
12  │                                                                                                  ^
1314  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.&lt;anonymous&gt; (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.&lt;anonymous&gt; (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:38

I 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.

Source https://stackoverflow.com/questions/69585145

QUESTION

Storybook error when using Webpack5 with Next.JS app + Typescript

Asked 2022-Feb-08 at 19:42

I 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

storybook

compared with what I get when I simply run

1next dev
2

nextdev

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 =&gt; Loading presets
12info =&gt; Serving static files from ././public at /
13info =&gt; Using implicit CSS loaders
14info =&gt; Using default Webpack5 setup
15&lt;i&gt; [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.&lt;anonymous&gt; (.\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), &lt;anonymous&gt;:247:1)
46    at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), &lt;anonymous&gt;: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 =&gt; Loading presets
12info =&gt; Serving static files from ././public at /
13info =&gt; Using implicit CSS loaders
14info =&gt; Using default Webpack5 setup
15&lt;i&gt; [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.&lt;anonymous&gt; (.\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), &lt;anonymous&gt;:247:1)
46    at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), &lt;anonymous&gt;: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    &quot;core&quot;: {
68        builder: &quot;webpack5&quot;
69    },
70    &quot;stories&quot;: [
71    &quot;../stories/**/*.stories.mdx&quot;,
72    &quot;../stories/**/*.stories.@(js|jsx|ts|tsx)&quot;
73    ],
74    &quot;addons&quot;: [
75    &quot;@storybook/addon-links&quot;,
76    &quot;@storybook/addon-essentials&quot;
77    ],
78    &quot;framework&quot;: &quot;@storybook/react&quot;
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 =&gt; Loading presets
12info =&gt; Serving static files from ././public at /
13info =&gt; Using implicit CSS loaders
14info =&gt; Using default Webpack5 setup
15&lt;i&gt; [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.&lt;anonymous&gt; (.\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), &lt;anonymous&gt;:247:1)
46    at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), &lt;anonymous&gt;: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    &quot;core&quot;: {
68        builder: &quot;webpack5&quot;
69    },
70    &quot;stories&quot;: [
71    &quot;../stories/**/*.stories.mdx&quot;,
72    &quot;../stories/**/*.stories.@(js|jsx|ts|tsx)&quot;
73    ],
74    &quot;addons&quot;: [
75    &quot;@storybook/addon-links&quot;,
76    &quot;@storybook/addon-essentials&quot;
77    ],
78    &quot;framework&quot;: &quot;@storybook/react&quot;
79}
80import &quot;../styles/globals.css&quot;;
81import * as NextImage from &quot;next/image&quot;;
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, &quot;default&quot;, {
86    configurable: true,
87    value: (props) =&gt; &lt;OriginalNextImage {...props} unoptimized /&gt;,
88});
89
90export const parameters = {
91actions: { argTypesRegex: &quot;^on[A-Z].*&quot; },
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 =&gt; Loading presets
12info =&gt; Serving static files from ././public at /
13info =&gt; Using implicit CSS loaders
14info =&gt; Using default Webpack5 setup
15&lt;i&gt; [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.&lt;anonymous&gt; (.\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), &lt;anonymous&gt;:247:1)
46    at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), &lt;anonymous&gt;: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    &quot;core&quot;: {
68        builder: &quot;webpack5&quot;
69    },
70    &quot;stories&quot;: [
71    &quot;../stories/**/*.stories.mdx&quot;,
72    &quot;../stories/**/*.stories.@(js|jsx|ts|tsx)&quot;
73    ],
74    &quot;addons&quot;: [
75    &quot;@storybook/addon-links&quot;,
76    &quot;@storybook/addon-essentials&quot;
77    ],
78    &quot;framework&quot;: &quot;@storybook/react&quot;
79}
80import &quot;../styles/globals.css&quot;;
81import * as NextImage from &quot;next/image&quot;;
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, &quot;default&quot;, {
86    configurable: true,
87    value: (props) =&gt; &lt;OriginalNextImage {...props} unoptimized /&gt;,
88});
89
90export const parameters = {
91actions: { argTypesRegex: &quot;^on[A-Z].*&quot; },
92controls: {
93    matchers: {
94    color: /(background|color)$/i,
95    date: /Date$/,
96    },
97},
98}
99{
100  &quot;name&quot;: &quot;client&quot;,
101  &quot;private&quot;: true,
102  &quot;scripts&quot;: {
103    &quot;dev&quot;: &quot;next dev&quot;,
104    &quot;build&quot;: &quot;next build&quot;,
105    &quot;start&quot;: &quot;next start&quot;,
106    &quot;lint&quot;: &quot;next lint&quot;,
107    &quot;storybook&quot;: &quot;start-storybook -p 6006 -s ./public&quot;,
108    &quot;build-storybook&quot;: &quot;build-storybook  -s ./public&quot;
109  },
110  &quot;dependencies&quot;: {
111    &quot;next&quot;: &quot;12.0.7&quot;,
112    &quot;react&quot;: &quot;17.0.2&quot;,
113    &quot;react-dom&quot;: &quot;17.0.2&quot;
114  },
115  &quot;devDependencies&quot;: {
116    &quot;@babel/core&quot;: &quot;^7.16.7&quot;,
117    &quot;@storybook/addon-actions&quot;: &quot;^6.4.9&quot;,
118    &quot;@storybook/addon-essentials&quot;: &quot;^6.4.9&quot;,
119    &quot;@storybook/addon-links&quot;: &quot;^6.4.9&quot;,
120    &quot;@storybook/builder-webpack5&quot;: &quot;^6.4.9&quot;,
121    &quot;@storybook/manager-webpack5&quot;: &quot;^6.4.9&quot;,
122    &quot;@storybook/react&quot;: &quot;^6.4.9&quot;,
123    &quot;@types/node&quot;: &quot;17.0.8&quot;,
124    &quot;@types/react&quot;: &quot;17.0.38&quot;,
125    &quot;babel-loader&quot;: &quot;^8.2.3&quot;,
126    &quot;eslint&quot;: &quot;8.6.0&quot;,
127    &quot;eslint-config-next&quot;: &quot;12.0.7&quot;,
128    &quot;eslint-plugin-storybook&quot;: &quot;^0.5.5&quot;,
129    &quot;typescript&quot;: &quot;4.5.4&quot;
130  }
131}
132

Steps to reproduce:

  1. npx create-next-app@latest --typescript
  2. cd my-app
  3. npx sb init
  4. n for eslint-plugin-storybook plugin fix
  5. yarn add @storybook/builder-webpack5 @storybook/manager-webpack5 --dev
  6. Update .storybook/main.js to include "core": { builder: "webpack5" }
  7. 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:42

Found 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 =&gt; Loading presets
12info =&gt; Serving static files from ././public at /
13info =&gt; Using implicit CSS loaders
14info =&gt; Using default Webpack5 setup
15&lt;i&gt; [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.&lt;anonymous&gt; (.\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), &lt;anonymous&gt;:247:1)
46    at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), &lt;anonymous&gt;: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    &quot;core&quot;: {
68        builder: &quot;webpack5&quot;
69    },
70    &quot;stories&quot;: [
71    &quot;../stories/**/*.stories.mdx&quot;,
72    &quot;../stories/**/*.stories.@(js|jsx|ts|tsx)&quot;
73    ],
74    &quot;addons&quot;: [
75    &quot;@storybook/addon-links&quot;,
76    &quot;@storybook/addon-essentials&quot;
77    ],
78    &quot;framework&quot;: &quot;@storybook/react&quot;
79}
80import &quot;../styles/globals.css&quot;;
81import * as NextImage from &quot;next/image&quot;;
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, &quot;default&quot;, {
86    configurable: true,
87    value: (props) =&gt; &lt;OriginalNextImage {...props} unoptimized /&gt;,
88});
89
90export const parameters = {
91actions: { argTypesRegex: &quot;^on[A-Z].*&quot; },
92controls: {
93    matchers: {
94    color: /(background|color)$/i,
95    date: /Date$/,
96    },
97},
98}
99{
100  &quot;name&quot;: &quot;client&quot;,
101  &quot;private&quot;: true,
102  &quot;scripts&quot;: {
103    &quot;dev&quot;: &quot;next dev&quot;,
104    &quot;build&quot;: &quot;next build&quot;,
105    &quot;start&quot;: &quot;next start&quot;,
106    &quot;lint&quot;: &quot;next lint&quot;,
107    &quot;storybook&quot;: &quot;start-storybook -p 6006 -s ./public&quot;,
108    &quot;build-storybook&quot;: &quot;build-storybook  -s ./public&quot;
109  },
110  &quot;dependencies&quot;: {
111    &quot;next&quot;: &quot;12.0.7&quot;,
112    &quot;react&quot;: &quot;17.0.2&quot;,
113    &quot;react-dom&quot;: &quot;17.0.2&quot;
114  },
115  &quot;devDependencies&quot;: {
116    &quot;@babel/core&quot;: &quot;^7.16.7&quot;,
117    &quot;@storybook/addon-actions&quot;: &quot;^6.4.9&quot;,
118    &quot;@storybook/addon-essentials&quot;: &quot;^6.4.9&quot;,
119    &quot;@storybook/addon-links&quot;: &quot;^6.4.9&quot;,
120    &quot;@storybook/builder-webpack5&quot;: &quot;^6.4.9&quot;,
121    &quot;@storybook/manager-webpack5&quot;: &quot;^6.4.9&quot;,
122    &quot;@storybook/react&quot;: &quot;^6.4.9&quot;,
123    &quot;@types/node&quot;: &quot;17.0.8&quot;,
124    &quot;@types/react&quot;: &quot;17.0.38&quot;,
125    &quot;babel-loader&quot;: &quot;^8.2.3&quot;,
126    &quot;eslint&quot;: &quot;8.6.0&quot;,
127    &quot;eslint-config-next&quot;: &quot;12.0.7&quot;,
128    &quot;eslint-plugin-storybook&quot;: &quot;^0.5.5&quot;,
129    &quot;typescript&quot;: &quot;4.5.4&quot;
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 =&gt; Loading presets
12info =&gt; Serving static files from ././public at /
13info =&gt; Using implicit CSS loaders
14info =&gt; Using default Webpack5 setup
15&lt;i&gt; [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.&lt;anonymous&gt; (.\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), &lt;anonymous&gt;:247:1)
46    at Hook.eval [as call] (eval at create (.\node_modules\@storybook\builder-webpack5\node_modules\tapable\lib\HookCodeFactory.js:19:10), &lt;anonymous&gt;: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    &quot;core&quot;: {
68        builder: &quot;webpack5&quot;
69    },
70    &quot;stories&quot;: [
71    &quot;../stories/**/*.stories.mdx&quot;,
72    &quot;../stories/**/*.stories.@(js|jsx|ts|tsx)&quot;
73    ],
74    &quot;addons&quot;: [
75    &quot;@storybook/addon-links&quot;,
76    &quot;@storybook/addon-essentials&quot;
77    ],
78    &quot;framework&quot;: &quot;@storybook/react&quot;
79}
80import &quot;../styles/globals.css&quot;;
81import * as NextImage from &quot;next/image&quot;;
82
83const OriginalNextImage = NextImage.default;
84
85Object.defineProperty(NextImage, &quot;default&quot;, {
86    configurable: true,
87    value: (props) =&gt; &lt;OriginalNextImage {...props} unoptimized /&gt;,
88});
89
90export const parameters = {
91actions: { argTypesRegex: &quot;^on[A-Z].*&quot; },
92controls: {
93    matchers: {
94    color: /(background|color)$/i,
95    date: /Date$/,
96    },
97},
98}
99{
100  &quot;name&quot;: &quot;client&quot;,
101  &quot;private&quot;: true,
102  &quot;scripts&quot;: {
103    &quot;dev&quot;: &quot;next dev&quot;,
104    &quot;build&quot;: &quot;next build&quot;,
105    &quot;start&quot;: &quot;next start&quot;,
106    &quot;lint&quot;: &quot;next lint&quot;,
107    &quot;storybook&quot;: &quot;start-storybook -p 6006 -s ./public&quot;,
108    &quot;build-storybook&quot;: &quot;build-storybook  -s ./public&quot;
109  },
110  &quot;dependencies&quot;: {
111    &quot;next&quot;: &quot;12.0.7&quot;,
112    &quot;react&quot;: &quot;17.0.2&quot;,
113    &quot;react-dom&quot;: &quot;17.0.2&quot;
114  },
115  &quot;devDependencies&quot;: {
116    &quot;@babel/core&quot;: &quot;^7.16.7&quot;,
117    &quot;@storybook/addon-actions&quot;: &quot;^6.4.9&quot;,
118    &quot;@storybook/addon-essentials&quot;: &quot;^6.4.9&quot;,
119    &quot;@storybook/addon-links&quot;: &quot;^6.4.9&quot;,
120    &quot;@storybook/builder-webpack5&quot;: &quot;^6.4.9&quot;,
121    &quot;@storybook/manager-webpack5&quot;: &quot;^6.4.9&quot;,
122    &quot;@storybook/react&quot;: &quot;^6.4.9&quot;,
123    &quot;@types/node&quot;: &quot;17.0.8&quot;,
124    &quot;@types/react&quot;: &quot;17.0.38&quot;,
125    &quot;babel-loader&quot;: &quot;^8.2.3&quot;,
126    &quot;eslint&quot;: &quot;8.6.0&quot;,
127    &quot;eslint-config-next&quot;: &quot;12.0.7&quot;,
128    &quot;eslint-plugin-storybook&quot;: &quot;^0.5.5&quot;,
129    &quot;typescript&quot;: &quot;4.5.4&quot;
130  }
131}
132reactDocgen: false
133module.exports = {
134   &quot;core&quot;: {
135      builder: &quot;webpack5&quot;
136   },
137   &quot;stories&quot;: [
138      &quot;../stories/**/*.stories.mdx&quot;,
139      &quot;../stories/**/*.stories.@(js|jsx|ts|tsx)&quot;
140   ],
141   &quot;addons&quot;: [
142      &quot;@storybook/addon-links&quot;,
143      &quot;@storybook/addon-essentials&quot;
144   ],
145   &quot;framework&quot;: &quot;@storybook/react&quot;,
146   typescript: {
147      check: false,
148      checkOptions: {},
149      reactDocgen: false,
150      reactDocgenTypescriptOptions: {
151         shouldExtractLiteralValuesFromEnum: true,
152         propFilter: (prop) =&gt; (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
153      },
154   },
155}
156

Source https://stackoverflow.com/questions/70637257

QUESTION

Colab: (0) UNIMPLEMENTED: DNN library is not found

Asked 2022-Feb-08 at 19:27

I 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&gt;=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&gt;=1.3.9 in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.5.12)
54Requirement already satisfied: psutil&gt;=5.4.3 in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (5.4.8)
55Requirement already satisfied: oauth2client in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;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&gt;=2.5.1-&gt;object-detection==0.1) (0.5.0)
60Requirement already satisfied: tensorflow-datasets in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;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&gt;=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&lt;6.0,&gt;=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&gt;=1.6.7 in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.12.10)
74Requirement already satisfied: numpy&gt;=1.15.4 in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.19.5)
75Requirement already satisfied: tensorflow-hub&gt;=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tf-models-official&gt;=2.5.1-&gt;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&gt;=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&lt;3dev,&gt;=1.16.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.35.0)
86Requirement already satisfied: uritemplate&lt;4dev,&gt;=3.0.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.0.1)
87Requirement already satisfied: httplib2&lt;1dev,&gt;=0.15.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.17.4)
88Requirement already satisfied: google-auth-httplib2&gt;=0.0.3 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.0.4)
89Requirement already satisfied: google-api-core&lt;3dev,&gt;=1.21.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.26.3)
90Requirement already satisfied: setuptools&gt;=40.3.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (57.4.0)
91Requirement already satisfied: pytz in /usr/local/lib/python3.7/dist-packages (from google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2018.9)
92Requirement already satisfied: googleapis-common-protos&lt;2.0dev,&gt;=1.6.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.54.0)
93Requirement already satisfied: requests&lt;3.0.0dev,&gt;=2.18.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2.23.0)
94Requirement already satisfied: packaging&gt;=14.3 in /usr/local/lib/python3.7/dist-packages (from google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (21.3)
95Requirement already satisfied: protobuf&gt;=3.12.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.17.3)
96Requirement already satisfied: pyasn1-modules&gt;=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth&lt;3dev,&gt;=1.16.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.2.8)
97Requirement already satisfied: rsa&lt;5,&gt;=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth&lt;3dev,&gt;=1.16.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (4.8)
98Requirement already satisfied: cachetools&lt;5.0,&gt;=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth&lt;3dev,&gt;=1.16.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (4.2.4)
99Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from kaggle&gt;=1.3.9-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2021.10.8)
100Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from kaggle&gt;=1.3.9-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.24.3)
101Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from kaggle&gt;=1.3.9-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2.8.2)
102Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from kaggle&gt;=1.3.9-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (4.62.3)
103Requirement already satisfied: python-slugify in /usr/local/lib/python3.7/dist-packages (from kaggle&gt;=1.3.9-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (5.0.2)
104Requirement already satisfied: pyparsing!=3.0.5,&gt;=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging&gt;=14.3-&gt;google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.0.7)
105Requirement already satisfied: pyasn1&lt;0.5.0,&gt;=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules&gt;=0.2.1-&gt;google-auth&lt;3dev,&gt;=1.16.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.4.8)
106Requirement already satisfied: idna&lt;3,&gt;=2.5 in /usr/local/lib/python3.7/dist-packages (from requests&lt;3.0.0dev,&gt;=2.18.0-&gt;google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2.10)
107Requirement already satisfied: chardet&lt;4,&gt;=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests&lt;3.0.0dev,&gt;=2.18.0-&gt;google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.0.4)
108Requirement already satisfied: termcolor&gt;=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.1.0)
109Requirement already satisfied: libclang&gt;=9.0.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (13.0.0)
110Requirement already satisfied: h5py&gt;=2.9.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.1.0)
111Requirement already satisfied: astunparse&gt;=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.6.3)
112Requirement already satisfied: gast&gt;=0.2.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.4.0)
113Requirement already satisfied: google-pasta&gt;=0.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.2.0)
114Requirement already satisfied: typing-extensions&gt;=3.6.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.10.0.2)
115Requirement already satisfied: wrapt&gt;=1.11.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.13.3)
116Requirement already satisfied: tensorflow-io-gcs-filesystem&gt;=0.23.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;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&gt;=1.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.1.2)
121Collecting tensorboard&lt;2.9,&gt;=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&gt;=1.12 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;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&gt;=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.3.0)
129Collecting numpy&gt;=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&gt;=0.4.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.0.0)
133Requirement already satisfied: grpcio&lt;2.0,&gt;=1.24.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.43.0)
134Requirement already satisfied: wheel&lt;1.0,&gt;=0.23.0 in /usr/local/lib/python3.7/dist-packages (from astunparse&gt;=1.6.0-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.37.1)
135Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py&gt;=2.9.0-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.5.2)
136Requirement already satisfied: tensorboard-data-server&lt;0.7.0,&gt;=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.6.1)
137Requirement already satisfied: werkzeug&gt;=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.0.1)
138Requirement already satisfied: google-auth-oauthlib&lt;0.5,&gt;=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.4.6)
139Requirement already satisfied: tensorboard-plugin-wit&gt;=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.8.1)
140Requirement already satisfied: markdown&gt;=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.3.6)
141Requirement already satisfied: requests-oauthlib&gt;=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib&lt;0.5,&gt;=0.4.1-&gt;tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.3.1)
142Requirement already satisfied: importlib-metadata&gt;=4.4 in /usr/local/lib/python3.7/dist-packages (from markdown&gt;=2.6.8-&gt;tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (4.10.1)
143Requirement already satisfied: zipp&gt;=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata&gt;=4.4-&gt;markdown&gt;=2.6.8-&gt;tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.7.0)
144Requirement already satisfied: oauthlib&gt;=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib&gt;=0.7.0-&gt;google-auth-oauthlib&lt;0.5,&gt;=0.4.1-&gt;tensorboard&lt;2.9,&gt;=2.8-&gt;tensorflow~=2.8.0-&gt;tf-models-official&gt;=2.5.1-&gt;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&gt;=0.4.1-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.1.6)
146Requirement already satisfied: crcmod&lt;2.0,&gt;=1.7 in /usr/local/lib/python3.7/dist-packages (from apache-beam-&gt;object-detection==0.1) (1.7)
147Collecting fastavro&lt;2,&gt;=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&lt;7.0.0,&gt;=0.15.1 in /usr/local/lib/python3.7/dist-packages (from apache-beam-&gt;object-detection==0.1) (6.0.1)
151Requirement already satisfied: pydot&lt;2,&gt;=1.2.0 in /usr/local/lib/python3.7/dist-packages (from apache-beam-&gt;object-detection==0.1) (1.3.0)
152Collecting proto-plus&lt;2,&gt;=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&lt;3.0.0dev,&gt;=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&lt;0.3.2,&gt;=0.3.1.1
159  Downloading dill-0.3.1.1.tar.gz (151 kB)
160     |████████████████████████████████| 151 kB 44.4 MB/s
161Collecting numpy&gt;=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&lt;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&lt;3.0.0,&gt;=2.1.0
168  Downloading hdfs-2.6.0-py3-none-any.whl (33 kB)
169Collecting pymongo&lt;4.0.0,&gt;=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&lt;3.0.0,&gt;=2.1.0-&gt;apache-beam-&gt;object-detection==0.1) (0.6.2)
173Collecting protobuf&gt;=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&lt;3.0.0dev,&gt;=2.18.0-&gt;google-api-core&lt;3dev,&gt;=1.21.0-&gt;google-api-python-client&gt;=1.6.7-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2.0.11)
177Requirement already satisfied: opencv-python&gt;=4.1.0.25 in /usr/local/lib/python3.7/dist-packages (from lvis-&gt;object-detection==0.1) (4.1.2.30)
178Requirement already satisfied: cycler&gt;=0.10.0 in /usr/local/lib/python3.7/dist-packages (from lvis-&gt;object-detection==0.1) (0.11.0)
179Requirement already satisfied: kiwisolver&gt;=1.1.0 in /usr/local/lib/python3.7/dist-packages (from lvis-&gt;object-detection==0.1) (1.3.2)
180Requirement already satisfied: text-unidecode&gt;=1.3 in /usr/local/lib/python3.7/dist-packages (from python-slugify-&gt;kaggle&gt;=1.3.9-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.3)
181Requirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from sacrebleu-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2019.12.20)
182Requirement already satisfied: tabulate&gt;=0.8.9 in /usr/local/lib/python3.7/dist-packages (from sacrebleu-&gt;tf-models-official&gt;=2.5.1-&gt;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&gt;=0.21.3 in /usr/local/lib/python3.7/dist-packages (from seqeval-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.0.2)
188Requirement already satisfied: joblib&gt;=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn&gt;=0.21.3-&gt;seqeval-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.1.0)
189Requirement already satisfied: threadpoolctl&gt;=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn&gt;=0.21.3-&gt;seqeval-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (3.1.0)
190Requirement already satisfied: typeguard&gt;=2.7 in /usr/local/lib/python3.7/dist-packages (from tensorflow-addons-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2.7.1)
191Requirement already satisfied: promise in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (2.3)
192Requirement already satisfied: future in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (0.16.0)
193Requirement already satisfied: attrs&gt;=18.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (21.4.0)
194Requirement already satisfied: importlib-resources in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (5.4.0)
195Requirement already satisfied: tensorflow-metadata in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets-&gt;tf-models-official&gt;=2.5.1-&gt;object-detection==0.1) (1.6.0)
196Collecting tensorflow-io-gcs-filesystem&gt;=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&lt;1.20,&gt;=1.16.0, but you have numpy 1.20.3 which is incompatible.
259multiprocess 0.70.12.2 requires dill&gt;=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&lt;0.2.7,&gt;=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:

  1. Nothing was changed inside pretrained model or already installed model or object_detection source files I downloaded a year ago.
  2. I tried to run command !pip install dnn - not working
  3. I tried to restart runtime (without disconnecting) - not working

Somebody can help? Thanks.

ANSWER

Answered 2022-Feb-07 at 09:19

It 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

Source https://stackoverflow.com/questions/71000120

QUESTION

Minikube dashboard ingress

Asked 2022-Feb-05 at 21:52

Im 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 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
24Rules:
25  Host           Path  Backends
26  ----           ----  --------
27  dashboard.com  
28                 /   kubernetes-dashboard:80 (172.17.0.4:9090)
29Annotations:     &lt;none&gt;
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 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
24Rules:
25  Host           Path  Backends
26  ----           ----  --------
27  dashboard.com  
28                 /   kubernetes-dashboard:80 (172.17.0.4:9090)
29Annotations:     &lt;none&gt;
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 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
24Rules:
25  Host           Path  Backends
26  ----           ----  --------
27  dashboard.com  
28                 /   kubernetes-dashboard:80 (172.17.0.4:9090)
29Annotations:     &lt;none&gt;
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] &quot;Creating API client&quot; host=&quot;https://10.96.0.1:443&quot;
49I1205 19:33:42.319750       7 main.go:265] &quot;Running in Kubernetes cluster&quot; major=&quot;1&quot; minor=&quot;22&quot; git=&quot;v1.22.3&quot; state=&quot;clean&quot; commit=&quot;c92036820499fedefec0f847e2054d824aea6cd1&quot; platform=&quot;linux/amd64&quot;
50I1205 19:33:42.402223       7 main.go:104] &quot;SSL fake certificate created&quot; file=&quot;/etc/ingress-controller/ssl/default-fake-certificate.pem&quot;
51I1205 19:33:42.413477       7 ssl.go:531] &quot;loading tls certificate&quot; path=&quot;/usr/local/certificates/cert&quot; key=&quot;/usr/local/certificates/key&quot;
52I1205 19:33:42.420838       7 nginx.go:253] &quot;Starting NGINX Ingress controller&quot;
53I1205 19:33:42.424731       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;ConfigMap&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller&quot;, UID:&quot;f2d27cc7-b103-490f-807f-18ccaa614e6b&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;664&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/ingress-nginx-controller
54I1205 19:33:42.427171       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;ConfigMap&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;tcp-services&quot;, UID:&quot;e174971d-df1c-4826-85d4-194598ab1912&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;665&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/tcp-services
55I1205 19:33:42.427195       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;ConfigMap&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;udp-services&quot;, UID:&quot;0ffc7ee9-2435-4005-983d-ed41aac1c9aa&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;666&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/udp-services
56I1205 19:33:43.622661       7 nginx.go:295] &quot;Starting NGINX process&quot;
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] &quot;Starting validation webhook&quot; address=&quot;:8443&quot; certPath=&quot;/usr/local/certificates/cert&quot; keyPath=&quot;/usr/local/certificates/key&quot;
59I1205 19:33:43.623683       7 controller.go:152] &quot;Configuration changes detected, backend reload required&quot;
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] &quot;New leader elected&quot; identity=&quot;ingress-nginx-controller-5f66978484-hvk9j&quot;
62I1205 19:33:43.691342       7 controller.go:169] &quot;Backend successfully reloaded&quot;
63I1205 19:33:43.691395       7 controller.go:180] &quot;Initial sync, sleeping for 1 second&quot;
64I1205 19:33:43.691435       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5f66978484-hvk9j&quot;, UID:&quot;55d45c26-eda7-4b37-9b04-5491cde39fd4&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;697&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
65I1205 21:06:47.402756       7 main.go:101] &quot;successfully validated configuration, accepting&quot; ingress=&quot;dashboard-ingress/kubernetes-dashboard&quot;
66I1205 21:06:47.408929       7 store.go:371] &quot;Found valid IngressClass&quot; ingress=&quot;kubernetes-dashboard/dashboard-ingress&quot; ingressclass=&quot;nginx&quot;
67I1205 21:06:47.409343       7 controller.go:152] &quot;Configuration changes detected, backend reload required&quot;
68I1205 21:06:47.409352       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;kubernetes-dashboard&quot;, Name:&quot;dashboard-ingress&quot;, UID:&quot;be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3&quot;, APIVersion:&quot;networking.k8s.io/v1&quot;, ResourceVersion:&quot;5529&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
69I1205 21:06:47.458273       7 controller.go:169] &quot;Backend successfully reloaded&quot;
70I1205 21:06:47.458445       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5f66978484-hvk9j&quot;, UID:&quot;55d45c26-eda7-4b37-9b04-5491cde39fd4&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;697&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
71I1205 21:07:43.654037       7 status.go:300] &quot;updating Ingress status&quot; namespace=&quot;kubernetes-dashboard&quot; ingress=&quot;dashboard-ingress&quot; currentValue=[] newValue=[{IP: Hostname:localhost Ports:[]}]
72I1205 21:07:43.660598       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;kubernetes-dashboard&quot;, Name:&quot;dashboard-ingress&quot;, UID:&quot;be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3&quot;, APIVersion:&quot;networking.k8s.io/v1&quot;, ResourceVersion:&quot;5576&quot;, FieldPath:&quot;&quot;}): 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:10

I 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.

Source https://stackoverflow.com/questions/70237546

QUESTION

NPM CI error bindings not accessible from watchpack-chokidar2:fsevents

Asked 2022-Feb-02 at 12:53

When 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  &quot;name&quot;: &quot;@blinktrade/uikit&quot;,
24  &quot;version&quot;: &quot;1.0.0&quot;,
25  &quot;main&quot;: &quot;dist/index.js&quot;,
26  &quot;license&quot;: &quot;MIT&quot;,
27  &quot;devDependencies&quot;: {
28    &quot;@babel/plugin-transform-react-jsx&quot;: &quot;^7.14.9&quot;,
29    &quot;@babel/preset-env&quot;: &quot;^7.15.6&quot;,
30    &quot;@babel/preset-react&quot;: &quot;^7.14.5&quot;,
31    &quot;@babel/preset-typescript&quot;: &quot;^7.15.0&quot;,
32    &quot;@storybook/addon-essentials&quot;: &quot;^6.3.8&quot;,
33    &quot;@storybook/react&quot;: &quot;^6.3.8&quot;,
34    &quot;@testing-library/jest-dom&quot;: &quot;^5.14.1&quot;,
35    &quot;@testing-library/react&quot;: &quot;^12.1.0&quot;,
36    &quot;@testing-library/user-event&quot;: &quot;^13.2.1&quot;,
37    &quot;@types/jest&quot;: &quot;^27.0.1&quot;,
38    &quot;@types/react&quot;: &quot;^17.0.21&quot;,
39    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.31.1&quot;,
40    &quot;@typescript-eslint/parser&quot;: &quot;^4.31.1&quot;,
41    &quot;eslint&quot;: &quot;^7.32.0&quot;,
42    &quot;eslint-plugin-react&quot;: &quot;^7.25.2&quot;,
43    &quot;husky&quot;: &quot;^7.0.2&quot;,
44    &quot;jest&quot;: &quot;^27.2.0&quot;,
45    &quot;prettier&quot;: &quot;^2.4.1&quot;,
46    &quot;pretty-quick&quot;: &quot;^3.1.1&quot;,
47    &quot;react&quot;: &quot;^17.0.2&quot;,
48    &quot;react-dom&quot;: &quot;^17.0.2&quot;,
49    &quot;rimraf&quot;: &quot;^3.0.2&quot;,
50    &quot;typescript&quot;: &quot;^4.4.3&quot;
51  },
52  &quot;husky&quot;: {
53    &quot;hooks&quot;: {
54      &quot;pre-push&quot;: &quot;npm run lint&quot;,
55      &quot;pre-commit&quot;: &quot;pretty-quick --staged&quot;
56    }
57  },
58  &quot;scripts&quot;: {
59    &quot;build&quot;: &quot;tsc -p .&quot;,
60    &quot;clear&quot;: &quot;rimraf dist/&quot;,
61    &quot;format&quot;: &quot;prettier '**/*' --write --ignore-unknown&quot;,
62    &quot;lint&quot;: &quot;eslint --max-warnings=0 .&quot;,
63    &quot;storybook&quot;: &quot;start-storybook -p 4000&quot;,
64    &quot;test&quot;: &quot;jest&quot;
65  }
66}
67

ANSWER

Answered 2021-Sep-20 at 20:57

Solved removing packages-lock.json and running again using NodeJS 14 (was 10)

Source https://stackoverflow.com/questions/69225852

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:42
1#include &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; 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:42

Since 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 &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; 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 &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19

Then in the line

1#include &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; 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 &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
20int t1 = x;
21std::cout &lt;&lt; t1 &lt;&lt; ' ';
22int t2 = addOne(x);
23std::cout &lt;&lt; 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 &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
20int t1 = x;
21std::cout &lt;&lt; t1 &lt;&lt; ' ';
22int t2 = addOne(x);
23std::cout &lt;&lt; t2;
24int&amp; y = addOne(x);
25int t = x;
26y = t;
27

Then in the line

1#include &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
20int t1 = x;
21std::cout &lt;&lt; t1 &lt;&lt; ' ';
22int t2 = addOne(x);
23std::cout &lt;&lt; t2;
24int&amp; y = addOne(x);
25int t = x;
26y = t;
27std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; 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 &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
20int t1 = x;
21std::cout &lt;&lt; t1 &lt;&lt; ' ';
22int t2 = addOne(x);
23std::cout &lt;&lt; t2;
24int&amp; y = addOne(x);
25int t = x;
26y = t;
27std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
28int t2 = addOne(x);
29int t1 = x;
30std::cout &lt;&lt; t1 &lt;&lt; ' ' &lt;&lt; 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 &lt;iostream&gt;
2
3int&amp; addOne(int&amp; x)
4{
5    x += 1;
6    return x;
7}
8
9int main()
10{
11    int x {5};
12    addOne(x) = x;
13    std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
14}
15addOne(x) = x;
16int t = x;
17int&amp; y = addOne(x);
18y = t; // same as x = t, because y will refer to x
19std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
20int t1 = x;
21std::cout &lt;&lt; t1 &lt;&lt; ' ';
22int t2 = addOne(x);
23std::cout &lt;&lt; t2;
24int&amp; y = addOne(x);
25int t = x;
26y = t;
27std::cout &lt;&lt; x &lt;&lt; ' ' &lt;&lt; addOne(x);
28int t2 = addOne(x);
29int t1 = x;
30std::cout &lt;&lt; t1 &lt;&lt; ' ' &lt;&lt; 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.

Source https://stackoverflow.com/questions/70909321

QUESTION

How to penetrate or cut holes through a 2D foreground

Asked 2022-Jan-22 at 03:11

I'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}&lt;!DOCTYPE html&gt;
18&lt;html lang="en"&gt;
19  &lt;head&gt;
20    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;
21    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"&gt;&lt;/script&gt;
22    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
23    &lt;meta charset="utf-8" /&gt;
24
25  &lt;/head&gt;
26  &lt;body&gt;
27    &lt;script src="sketch.js"&gt;&lt;/script&gt;
28  &lt;/body&gt;
29&lt;/html&gt;

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:11

The 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}&lt;!DOCTYPE html&gt;
18&lt;html lang="en"&gt;
19  &lt;head&gt;
20    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;
21    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"&gt;&lt;/script&gt;
22    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
23    &lt;meta charset="utf-8" /&gt;
24
25  &lt;/head&gt;
26  &lt;body&gt;
27    &lt;script src="sketch.js"&gt;&lt;/script&gt;
28  &lt;/body&gt;
29&lt;/html&gt;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}&lt;!DOCTYPE html&gt;
18&lt;html lang="en"&gt;
19  &lt;head&gt;
20    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;
21    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"&gt;&lt;/script&gt;
22    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
23    &lt;meta charset="utf-8" /&gt;
24
25  &lt;/head&gt;
26  &lt;body&gt;
27    &lt;script src="sketch.js"&gt;&lt;/script&gt;
28  &lt;/body&gt;
29&lt;/html&gt;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}&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;

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}&lt;!DOCTYPE html&gt;
18&lt;html lang="en"&gt;
19  &lt;head&gt;
20    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;
21    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"&gt;&lt;/script&gt;
22    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
23    &lt;meta charset="utf-8" /&gt;
24
25  &lt;/head&gt;
26  &lt;body&gt;
27    &lt;script src="sketch.js"&gt;&lt;/script&gt;
28  &lt;/body&gt;
29&lt;/html&gt;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}&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;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}&lt;!DOCTYPE html&gt;
18&lt;html lang="en"&gt;
19  &lt;head&gt;
20    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;
21    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"&gt;&lt;/script&gt;
22    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
23    &lt;meta charset="utf-8" /&gt;
24
25  &lt;/head&gt;
26  &lt;body&gt;
27    &lt;script src="sketch.js"&gt;&lt;/script&gt;
28  &lt;/body&gt;
29&lt;/html&gt;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}&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;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}&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"&gt;&lt;/script&gt;

Source https://stackoverflow.com/questions/70807530

QUESTION

Linking local Openssl to Nodejs C++ addon

Asked 2022-Jan-09 at 23:32

I 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  &quot;targets&quot;: [
3    {
4      &quot;target_name&quot;: &quot;module&quot;,
5      &quot;include_dirs&quot;: [ &quot;/opt/homebrew/opt/openssl@3/include&quot; ],
6      &quot;sources&quot;: [ &quot;./module.cpp&quot; ],
7      &quot;libraries&quot;: [
8            &quot;/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib&quot;,
9            &quot;/opt/homebrew/opt/openssl@3/lib/libcrypto.a&quot;,
10            &quot;/opt/homebrew/opt/openssl@3/lib/libcrypto.dylib&quot;
11        ]
12    }
13    ]
14}
15

ANSWER

Answered 2022-Jan-09 at 23:32

This 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  &quot;targets&quot;: [
3    {
4      &quot;target_name&quot;: &quot;module&quot;,
5      &quot;include_dirs&quot;: [ &quot;/opt/homebrew/opt/openssl@3/include&quot; ],
6      &quot;sources&quot;: [ &quot;./module.cpp&quot; ],
7      &quot;libraries&quot;: [
8            &quot;/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib&quot;,
9            &quot;/opt/homebrew/opt/openssl@3/lib/libcrypto.a&quot;,
10            &quot;/opt/homebrew/opt/openssl@3/lib/libcrypto.dylib&quot;
11        ]
12    }
13    ]
14}
15&quot;OPENSSL_API_COMPAT=0x10100001L&quot;,
16&quot;OPENSSL_CONFIGURED_API=0x30000000L&quot;
17

I am the author of both the issue and the workaround.

Source https://stackoverflow.com/questions/70541687

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

Share this Page

share link

Get latest updates on Addon