Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

TypeError: Cannot read property 'greetingEndpoint' of undefined #86

Open
gastaldi opened this issue Mar 20, 2019 · 1 comment
Open

TypeError: Cannot read property 'greetingEndpoint' of undefined #86

gastaldi opened this issue Mar 20, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gastaldi
Copy link
Contributor

gastaldi commented Mar 20, 2019

Having the following configuration breaks the application:

{
	"application": "charming-machine",
	"parts": [{
		"shared": {
			"runtime": {
				"name": "dotnet",
				"version": "community"
			},
			"dotnet": {
				"namespace": "MyApp",
				"version": "1.0.0"
			}
		},
		"extra": {
			"runtimeInfo": {
				"image": "registry.access.redhat.com/dotnet/dotnet-22-rhel7",
				"enumInfo": {
					"id": "dotnet",
					"name": ".NET Core",
					"icon": "data:image/svg+xml;charset=utf8,%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 32 32' style='enable-background:new 0 0 32 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23008CDB;%7D%0A%3C/style%3E%3Cpath class='st0' d='M32,9.56h-8.72v1.28h3.59V22h1.53V10.84H32V9.56z M21.81,10.84V9.56h-6.66V22h6.66v-1.28h-5.12v-4.34h4.56 v-1.31h-4.56v-4.22H21.81z M2.16,21.41c0,0.29-0.1,0.54-0.31,0.75s-0.47,0.31-0.78,0.31c-0.29,0-0.54-0.1-0.75-0.31 C0.1,21.95,0,21.7,0,21.41c0-0.31,0.1-0.57,0.31-0.78s0.46-0.31,0.75-0.31c0.31,0,0.57,0.1,0.78,0.31S2.16,21.09,2.16,21.41 L2.16,21.41z M13.41,9.56h-1.53v9.81l-7-9.81H3.34V22h1.53v-9.81L11.91,22h1.5V9.56z'/%3E%3C/svg%3E%0A",
					"description": "Create stand-alone, production-grade .NET Core Applications that you can \"just run\".",
					"metadata": {
						"categories": ["backend"],
						"language": "csharp",
						"website": "https://dotnet.microsoft.com/apps/aspnet"
					}
				},
				"service": "charming-machine",
				"route": "charming-machine"
			},
			"category": "backend"
		},
		"capabilities": [{
			"module": "health",
			"props": {},
			"extra": {
				"category": "backend"
			}
		}, {
			"module": "rest",
			"props": {},
			"extra": {
				"category": "backend"
			}
		}, {
			"module": "database",
			"props": {
				"databaseType": "mysql"
			},
			"extra": {
				"category": "backend",
				"databaseInfo": {
					"image": "mysql",
					"service": "charming-machine-database-bind"
				}
			}
		}, {
			"module": "welcome",
			"props": {},
			"extra": {
				"category": "support"
			}
		}]
	}]
}

This is the error seen in the console

TypeError: Cannot read property 'greetingEndpoint' of undefined
    at e.render (RestCapability.tsx:63)
    at sr (react-dom.production.min.js:163)
    at ir (react-dom.production.min.js:162)
    at mr (react-dom.production.min.js:169)
    at Jr (react-dom.production.min.js:204)
    at Ur (react-dom.production.min.js:205)
    at Oi (react-dom.production.min.js:220)
    at Ai (react-dom.production.min.js:219)
    at zi (react-dom.production.min.js:216)
    at Qr (react-dom.production.min.js:214)
gr @ react-dom.production.min.js:179
react-dom.production.min.js:179 TypeError: Cannot read property 'dbEndpoint' of undefined
    at e.render (DatabaseCapability.tsx:68)
    at sr (react-dom.production.min.js:163)
    at ir (react-dom.production.min.js:162)
    at mr (react-dom.production.min.js:169)
    at Jr (react-dom.production.min.js:204)
    at Ur (react-dom.production.min.js:205)
    at Oi (react-dom.production.min.js:220)
    at Ai (react-dom.production.min.js:219)
    at zi (react-dom.production.min.js:216)
    at Qr (react-dom.production.min.js:214)
gr @ react-dom.production.min.js:179
@gastaldi gastaldi changed the title Undefined TypeError: Cannot read property 'greetingEndpoint' of undefined Mar 20, 2019
@gastaldi gastaldi added the bug Something isn't working label Mar 20, 2019
@quintesse
Copy link
Contributor

The problem should already be fixed in the LCB, but I think it's desirable that the Welcome App is robust enough to not fail completely when non-essential information like that is missing. (In this case it was the developer of the particular generator that didn't understand what those properties were for and had just removed them). In general we can say that the information in the extra property is potentially untrustworthy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants