Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Client not working - angular not defined #6

Open
EHJ-52n opened this issue Nov 18, 2016 · 3 comments
Open

Client not working - angular not defined #6

EHJ-52n opened this issue Nov 18, 2016 · 3 comments
Assignees
Labels

Comments

@EHJ-52n
Copy link
Member

EHJ-52n commented Nov 18, 2016

Hi,
I followed your instructions to build the latest release. When launching the client with the commandline:

node_modules/http-server/bin/http-server --cors -p 8888 dist

I receive the following error message in the javascript console:

wps-js-client-all.min.js:2 Uncaught ReferenceError: angular is not defined

The returned website:

<!DOCTYPE html>
<html lang="en" ng-app="wpsClient">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>WPS JS Client</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
	content="WPS Client for intracting with Web Processing Services">

<link rel="stylesheet" href="css/deps.wps-js-client.min.css"/>

<link rel="stylesheet" href="css/wps-js-client.min.css"/>

</head>
<body>

	<!--[if lt IE 7]>
      <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  <![endif]-->

	<!-- embed the user interface via angular -->
	<wps-user-interface></wps-user-interface>

	<script src="js/deps.wps-js-client.min.js"></script>

	<script src="wps-js-client-all.min.js"></script>
	
	<div>
	<p class="infotext">wps-js-client - version 0.1.0 - build at 2016-11-18 08:56</p>
	</div>
	
</body>
</html>

The file js/deps.wps-js-client.min.js and /css/deps.wps-js-client.min.css are empty. In the dist folder, I have the following files:

/usr/src/app # ls -l dist
total 60
drwxr-xr-x    3 root     root          4096 Nov 18 09:47 components
drwxr-xr-x    2 root     root          4096 Nov 18 09:47 css
drwxr-xr-x    2 root     root          4096 Nov 18 09:47 i18n
-rw-r--r--    1 root     root           994 Nov 18 09:47 index.html
drwxr-xr-x    2 root     root          4096 Nov 18 09:47 js
-rw-r--r--    1 root     root         38649 Nov 18 09:47 wps-js-client-all.min.js
/usr/src/app # ls -l dist/js/
total 76
-rw-r--r--    1 root     root             0 Nov 18 09:47 deps.wps-js-client.min.js
-rw-r--r--    1 root     root         75366 Nov 18 09:47 wps-js-client-all.js
/usr/src/app # ls -l dist/css/
total 8
-rw-r--r--    1 root     root             0 Nov 18 09:47 deps.wps-js-client.css
-rw-r--r--    1 root     root             0 Nov 18 09:47 deps.wps-js-client.min.css
-rw-r--r--    1 root     root          1714 Nov 18 09:47 wps-js-client.css
-rw-r--r--    1 root     root           951 Nov 18 09:47 wps-js-client.min.css

My set-up is the following:

  • node 7.1.0
  • alpine linux 3.4.4 in docker image

Do you need any additional information?

@EHJ-52n EHJ-52n added the bug label Nov 18, 2016
@EHJ-52n EHJ-52n changed the title Cannot build an run Client not working - angular not defined Nov 18, 2016
@cDanowski
Copy link
Contributor

I now updated the branch and also the installation instructions.

Did you perform a "grunt" or "grunt buildWar" to build the application? When performing "grunt" the 'dist' folder is regenerated. I have tested it and it should work now.

Can you please re-test?

@EHJ-52n
Copy link
Member Author

EHJ-52n commented Nov 22, 2016

I am build the webapp using grunt. The log output of the build:

Running "clean:0" (clean) task
>> 0 paths cleaned.

Running "concat:libs" (concat) task

Running "concat:wps" (concat) task

Running "concat:styles" (concat) task

Running "concat:libStyles" (concat) task

Running "uglify:appJs" (uglify) task
File dist/wps-js-client-all.min.js created: 127.23 kB → 50.12 kB
>> 1 file created.

Running "cssmin:styles" (cssmin) task
>> 1 file created. 2.69 kB → 1.7 kB

Running "cssmin:depStyles" (cssmin) task
>> 1 file created. 0 B → 0 B

Running "copy:locals" (copy) task
Copied 32 files

Running "copy:css" (copy) task


Running "copy:fonts" (copy) task


Running "processhtml:index" (processhtml) task

Done.

and than serve the webapp using:

./node_modules/http-server/bin/http-server --cors -p 8888 dist

The files mentioned above are still empty.

In addition, the favicon.ico file is missing:

"GET /favicon.ico" Error (404): "Not found"

Another error message:

npm WARN lifecycle [email protected]~postinstall: cannot run in wd %s %s (wd=%s) [email protected] bower install /usr/src/app

And you are somehow using outdated packages:

npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

The complete log file of the build: build.txt

@cDanowski
Copy link
Contributor

I just tested it on another windows machine, where none of the required technologies was installed.

Hence, I installed git, node, npm and grunt.

I cloned the repository and ran npm install, hereby I was prompted to choose a concrete version of leaflet-draw (decision between master and a version 0.4.1 - I chose the latter). Did you receive a similar prompt?

Then I ran grunt and it created all files perfectly within the dist folder.

My guess is, that somehow on your machine, the bower dependencies are not properly installed in folder wps-js-client\app\bower_components. Maybe you could try to perform a manual bower install within the repository. It should have the following contents:

image

Maybe we should do a GoTo-Meeting to analyse this issue more directly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants