Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

training/app-basemap does not display #27

Open
jodygarnett opened this issue Feb 5, 2018 · 6 comments
Open

training/app-basemap does not display #27

jodygarnett opened this issue Feb 5, 2018 · 6 comments

Comments

@jodygarnett
Copy link

Prepping app-basemap onto new training VM has two problems:

  1. Looks like app uses a CDN, cannot use that for teaching on discounted network

  2. app does not display console:

app.js:605 Uncaught TypeError: e.getSource is not a function
    at t.value (app.js:605)
    at t.value (app.js:605)
    at new t (app.js:285)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (app.js:2723)
    at ReactCompositeComponentWrapper._constructComponent (app.js:2723)
    at ReactCompositeComponentWrapper.mountComponent (app.js:2723)
    at Object.mountComponent (app.js:2825)
    at ReactCompositeComponentWrapper.performInitialMount (app.js:2723)
    at ReactCompositeComponentWrapper.mountComponent (app.js:2723)
    at Object.mountComponent (app.js:2825)
value @ app.js:605
value @ app.js:605
t @ app.js:285
_constructComponentWithoutOwner @ app.js:2723
_constructComponent @ app.js:2723
mountComponent @ app.js:2723
mountComponent @ app.js:2825
performInitialMount @ app.js:2723
mountComponent @ app.js:2723
mountComponent @ app.js:2825
mountChildren @ app.js:2803
_createInitialChildren @ app.js:2731
mountComponent @ app.js:2731
mountComponent @ app.js:2825
performInitialMount @ app.js:2723
mountComponent @ app.js:2723
mountComponent @ app.js:2825
performInitialMount @ app.js:2723
mountComponent @ app.js:2723
mountComponent @ app.js:2825
performInitialMount @ app.js:2723
mountComponent @ app.js:2723
mountComponent @ app.js:2825
mountComponentIntoNode @ app.js:2801
perform @ app.js:2871
batchedMountComponentIntoNode @ app.js:2801
perform @ app.js:2871
batchedUpdates @ app.js:2767
batchedUpdates @ app.js:2835
_renderNewRootComponent @ app.js:2801
_renderSubtreeIntoContainer @ app.js:2801
render @ app.js:2801
1.boundless-sdk/components/HomeButton @ app.js:2
s @ app.js:1
e @ app.js:1
(anonymous) @ app.js:1
app.js:2735 Uncaught TypeError: Cannot read property '__reactInternalInstance$3c26if9n3ve' of null
    at Object.getClosestInstanceFromNode (app.js:2735)
    at findParent (app.js:2781)
    at handleTopLevelImpl (app.js:2781)
    at ReactDefaultBatchingStrategyTransaction.perform (app.js:2871)
    at Object.batchedUpdates (app.js:2767)
    at Object.batchedUpdates (app.js:2835)
    at dispatchEvent (app.js:2781)
getClosestInstanceFromNode @ app.js:2735
findParent @ app.js:2781
handleTopLevelImpl @ app.js:2781
perform @ app.js:2871
batchedUpdates @ app.js:2767
batchedUpdates @ app.js:2835
dispatchEvent @ app.js:2781
@jodygarnett
Copy link
Author

We may be able to use the quickview app for a lot of this functionality in the course.

@tbarsballe
Copy link
Contributor

I tried out the WAR locally, and got the same error.
When I run the app using npm start, it works fine.
If I substitute the app-debug.js into the war, I instead get the following error:

Uncaught TypeError: Cannot read property 'format' of undefined
    at Object.<anonymous> (WFSService.js:53)
    at Object.283.../util (WFSService.js:436)
    at s (_prelude.js:1)
    at _prelude.js:1
    at Object.287.../constants/LayerConstants (LayerStore.js:23)
    at s (_prelude.js:1)
    at _prelude.js:1
    at Object.<anonymous> (MapPanel.js:33)
    at Object.138.../stores/LayerStore (MapPanel.js:249)
    at s (_prelude.js:1)

Debugging into WFSService, it look like _openlayers2 = { "default": undefined }.
When running using npm start, instead _openlayers2 is fully set, which is why there is no error then.

Looking at sdk master, seems like WFSService doesn't exist anymore?

@bartvde
Copy link
Contributor

bartvde commented Feb 5, 2018

SDK master is 2.x and is a complete rewrite of 1.x

@tbarsballe
Copy link
Contributor

That explains that. Looking at 1.x branch, I don't see the problematic call either. Seems like the training-apps depend upon "boundless-sdk": "^0.10.2" (Actuall version downloaded is 0.10.32). An update to SDK 1.x latest might be the simplest fix?

@bartvde
Copy link
Contributor

bartvde commented Feb 6, 2018

ah I see what is the issue, a mismatch of openlayers versions, will fix

@bartvde
Copy link
Contributor

bartvde commented Feb 6, 2018

@jgarnett please check out the changes I did in master just now: b798453

Please note you will need to clear out your node_modules and run npm install again
The syntax for creating the war has also slightly changed see the README of that app

I removed the cdnjs reference, assuming you will use Chrome for training. Chrome doesn't need any of the polyfills.

If similar changes are needed to the other training apps, let me know

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

No branches or pull requests

3 participants