OHDSI Home | Forums | Wiki | Github

Cannot read property 'url'

Hi there, I greatly appreciate all the help I’ve gotten so far. After setting up a trial on Ubuntu I was asked to troubleshoot an installation on Windows Server, running WebAPI on Tomcat and Atlas on IIS, pointing to an OMOP database using Achilles. Accessing the WebAPI using localhost:8080/WebAPI seems to work just fine. My Atlas configuration that tries to connect to it, however, just hangs there. The console shows the following errors, indicating that the variable config.api.url in main.js has not been set. Is this variable supposed to be set in config.js, and if so would you have any idea where I have gone wrong?

main.js:185 Uncaught TypeError: Cannot read property 'url' of undefined
    at main.js:185
    at Object.execCb (require.js:29)
    at Z.check (require.js:18)
    at Z.<anonymous> (require.js:23)
    at require.js:8
    at require.js:23
    at v (require.js:7)
    at Z.emit (require.js:23)
    at Z.check (require.js:19)
    at Z.<anonymous> (require.js:23)

jquery-1.11.2.min.js:4 GET http://localhost:8080/WebAPI/vocabulary/OMOP_Vocabulary/domains

The following are the contents of my config.js file.

define([], function() 
{ 
	var config = {};
	config.services = [{
		name : 'UCSD Atlas',
		url: 'http://localhost:8080/WebAPI/'
	}];

	config.webAPIRoot = config.services[0].url ;

	config.dataSourcesLocation = '/AchillesWeb-master/data/datasources.json'; 
	config.dataSourcesRoot = '/AchillesWeb-master/data';
	
	return config ;
});

As of Atlas 2.2.0, we’ve reworked how the configuration works for Atlas.

You don’t need to modify config.js anymore, instead you craeet a config-local.js to override specific settings. In addition, we no longer refer to an array of services, there’s just one main webAPI that atlas points to. So your config-local.js should just set things you want to override. Here’s an example:

define([], function () {
	var config = {};

	config.api =
		{
			name: 'My WebAPI',
			url: 'http://someHost:8080/WebAPI/'
		};
	return config;
});

Notice how config doesn’t have services array anymore.

Thank you very much for your help! After restoring config.js to the original and adding the config-local.js that problem was solved.

I am now getting an error related to a font file, though:

jquery-1.11.2.min.js:3
GET http://localhost/Atlas-master/js/fonts/fontawesome-webfont.woff2?v=4.4.0
net::ERR_ABORTED
Jb	@	jquery-1.11.2.min.js:3
css	@	jquery-1.11.2.min.js:3
U	@	jquery-1.11.2.min.js:3
Vb	@	jquery-1.11.2.min.js:3
show	@	jquery-1.11.2.min.js:3
m.fn.(anonymous function)	@	jquery-1.11.2.min.js:4
e.fn.extend.show	@	jquery-ui.min.js:10
(anonymous)	@	app.js:323
setTimeout (async)		
self.initComplete	@	app.js:321
(anonymous)	@	main.js:337
j	@	jquery-1.11.2.min.js:2
add	@	jquery-1.11.2.min.js:2
(anonymous)	@	main.js:336
execCb	@	require.js:29
check	@	require.js:18
(anonymous)	@	require.js:23
(anonymous)	@	require.js:8
(anonymous)	@	require.js:23
v	@	require.js:7
emit	@	require.js:23
check	@	require.js:19
(anonymous)	@	require.js:23
(anonymous)	@	require.js:8
(anonymous)	@	require.js:23
v	@	require.js:7
emit	@	require.js:23
check	@	require.js:19
(anonymous)	@	require.js:23
(anonymous)	@	require.js:8
(anonymous)	@	require.js:23
v	@	require.js:7
emit	@	require.js:23
check	@	require.js:19
(anonymous)	@	require.js:23
(anonymous)	@	require.js:8
(anonymous)	@	require.js:23
v	@	require.js:7
emit	@	require.js:23
check	@	require.js:19
enable	@	require.js:23
init	@	require.js:17
E	@	require.js:14
completeLoad	@	require.js:28
onScriptLoad	@	require.js:30

The file in question (js/fonts/fontawesome-webfont.woff2) is definitely at the path indicated.

You can ignore that error.

1 Like

Thanks so much for all of your help, Chris!

t