odoe / generator-arcgis-js-app

Generator for ArcGIS JS API applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dojo build not working after running generator

tomwayson opened this issue · comments

After a fresh install I run:

npm start

App runs, and I can hit the Intern test page and all is good. ✔️

Then I run:

npm release

Uh oh. Dojo build error. At the command line I see:

....
waiting for the optimizer runner to finish...
starting reporting...
Report written to C:/code/test/yo-ags-app-master/built/build-report.txt
Process finished normally.
        errors: 71
        warnings: 182
        build time: 109.273 seconds
>> dojo build error: Error
Warning: Task "dojo:dist" failed. Use --force to continue.

Aborted due to warnings.

Looking into build report I see:

error(311) Missing dependency.
    module: esri/dijit/AppProxySettings; dependency: dgrid/OnDemandGrid
    module: esri/dijit/AppProxySettings; dependency: dgrid/Selection
    module: esri/dijit/AppProxySettings; dependency: dgrid/editor
    module: esri/dijit/BrowseItems; dependency: dgrid/Grid
    module: esri/dijit/BrowseItems; dependency: dgrid/extensions/Pagination
    module: esri/dijit/BrowseItems; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/BrowseItems; dependency: dgrid/OnDemandGrid
    module: esri/dijit/BrowseItems; dependency: dgrid/Selection
    module: esri/dijit/BrowseItems; dependency: dgrid/selector
    module: esri/dijit/BrowseItems; dependency: dgrid/Keyboard
    module: esri/dijit/BrowseItems; dependency: dgrid/util/mouse
    module: esri/dijit/BrowseItems; dependency: dgrid/util/touch
    module: esri/dijit/BrowseItems; dependency: put-selector/put
    module: esri/dijit/CalculateField; dependency: dgrid/OnDemandList
    module: esri/dijit/CalculateField; dependency: dgrid/Selection
    module: esri/dijit/CalculateField; dependency: dgrid/Keyboard
    module: esri/dijit/CalculateField; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/CalculateField; dependency: dgrid/util/mouse
    module: esri/dijit/CalculateField; dependency: put-selector/put
    module: esri/dijit/ElevationProfile; dependency: xstyle/css!./ElevationProfile/css/ElevationProfile.css
    module: esri/dijit/FeatureTable; dependency: dgrid/OnDemandGrid
    module: esri/dijit/FeatureTable; dependency: dgrid/Selection
    module: esri/dijit/FeatureTable; dependency: dgrid/selector
    module: esri/dijit/FeatureTable; dependency: dgrid/Keyboard
    module: esri/dijit/FeatureTable; dependency: dgrid/editor
    module: esri/dijit/FeatureTable; dependency: dgrid/extensions/Pagination
    module: esri/dijit/FeatureTable; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/FeatureTable; dependency: dgrid/extensions/ColumnHider
    module: esri/dijit/FeatureTable; dependency: dgrid/extensions/ColumnResizer
    module: esri/dijit/GeocodeMatch; dependency: dgrid/OnDemandGrid
    module: esri/dijit/GeocodeMatch; dependency: dgrid/Selection
    module: esri/dijit/GeocodeMatch; dependency: dgrid/Keyboard
    module: esri/dijit/GeocodeMatch; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/GeocodeMatch; dependency: dgrid/extensions/ColumnResizer
    module: esri/dijit/GeocodeMatch; dependency: dgrid/extensions/ColumnHider
    module: esri/dijit/GeocodeReview; dependency: dgrid/OnDemandGrid
    module: esri/dijit/GeocodeReview; dependency: dgrid/Selection
    module: esri/dijit/GeocodeReview; dependency: dgrid/Keyboard
    module: esri/dijit/GeocodeReview; dependency: dgrid/editor
    module: esri/dijit/GeocodeReview; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/GeocodeReview; dependency: dgrid/extensions/ColumnHider
    module: esri/dijit/RasterList; dependency: dgrid/OnDemandList
    module: esri/dijit/RasterList; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/RasterList; dependency: dgrid/Selection
    module: esri/dijit/Tags; dependency: dgrid/OnDemandGrid
    module: esri/dijit/Tags; dependency: dgrid/Selection
    module: esri/dijit/Tags; dependency: dgrid/Keyboard
    module: esri/dijit/analysis/EnrichLayer; dependency: dgrid/List
    module: esri/dijit/analysis/ExpressionGrid; dependency: dgrid/OnDemandGrid
    module: esri/dijit/analysis/ExpressionGrid; dependency: dgrid/Keyboard
    module: esri/dijit/analysis/ExpressionGrid; dependency: dgrid/Selection
    module: esri/dijit/analysis/ExpressionGrid; dependency: dgrid/selector
    module: esri/dijit/analysis/ExpressionGrid; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/analysis/ExpressionGrid; dependency: dgrid/util/mouse
    module: esri/dijit/analysis/ExpressionGrid; dependency: put-selector/put
    module: esri/dijit/analysis/tree; dependency: dgrid/util/has-css3
    module: esri/dijit/analysis/tree; dependency: dgrid/Grid
    module: esri/dijit/analysis/tree; dependency: put-selector/put
    module: esri/dijit/geoenrichment/CheckList; dependency: dgrid/List
    module: esri/dijit/geoenrichment/CheckList; dependency: dgrid/Selection
    module: esri/dijit/geoenrichment/EnrichOptionsPage; dependency: dgrid/OnDemandGrid
    module: esri/dijit/geoenrichment/EnrichOptionsPage; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/geoenrichment/EnrichOptionsPage; dependency: dgrid/tree
    module: esri/dijit/geoenrichment/Pagination; dependency: dgrid/List
    module: esri/dijit/geoenrichment/DataBrowser/DataCollectionsPage; dependency: dgrid/List
    module: esri/dijit/geoenrichment/DataBrowser/DataCollectionsPage; dependency: dgrid/Selection
    module: esri/dijit/geoenrichment/DataBrowser/DataVariablesPage; dependency: dgrid/tree
    module: esri/dijit/geoenrichment/DataBrowser/DataVariablesPage; dependency: dgrid/OnDemandGrid
    module: esri/dijit/geoenrichment/DataBrowser/DataVariablesPage; dependency: dgrid/extensions/DijitRegistry
    module: esri/dijit/geoenrichment/DataBrowser/DataVariablesPage; dependency: dgrid/Selection
    module: esri/dijit/geoenrichment/DataBrowser/ShoppingCart; dependency: dgrid/List

Looking like a problem w/ dgrid version (and maybe put-selector)?

Tested on Mac on a fresh app and it worked on first try. I'll test on Linux and Windows in a bit.

Hmm... I had been assuming that it was something to do w/ package versions not being right, I've deleted and reinstalled all bower deps but I still get the same error. I double checked a few of the missing deps, and they appear to be in the right spots under dist.

Here's what bower deps I have installed:

>bower ls
bower check-new     Checking for new versions of the project dependencies...
ThisIsMaster#0.1.0 
└─┬ esri#3.16.0
  ├── dgrid#0.3.17/esri-3.14.0
  ├── dijit#v1.10.4/esri-3.14.0
  ├── dojo#v1.10.4/esri-3.14.0
  ├── dojox#v1.10.4/esri-3.14.0
  ├─┬ dstore#1.1.0 (latest is 1.1.1)
  │ └── dojo#v1.10.4/esri-3.14.0 incompatible with >=1.8.1 (1.11.0 available)
  ├── moment#2.12.0
  ├── put-selector#0.3.6
  ├── util#v1.10.4/esri-3.14.0
  └── xstyle#0.1.3/esri-3.14.0

Do you see same incompatibility warning?

Then I figured it might be b/c I had run the generator from my locally cloned master via npm link on the off chance that one of the more recent commits was messing w/ the output somehow, so I unlinked it and installed via yo (v1.7.0). Same error. 😦

Maybe it's something more specific to my env?:

>node -v
v4.2.4

>npm -v
2.14.12

>bower -v
1.7.7

I'll be curious if it works for you on Windows.

Works on Linux
npm = 3.3.12
node = v5.4.1
bower = 1.7.7

Oh and that incompatibility warning can be ignored. It's just because we use the forked dojo version.

FYI - in testing the intern fixes for #13 on my Mac, I also tested the build, but I could not get it to work there either. Same error as above. Here's the env:

$ node -v
v4.2.4

$ npm -v
2.14.12

$ bower -v
1.7.2

I then tried (back on my PC) to install and use node 5.4 via nvm w/ fresh global installs of npm, bower, yo, and the generator (0.2.3), which is as close as I can get to having a "clean" env on this machine. No dice. Same error.

I can't get this Dojo build to run and I've tried on multiple machines and node virtual machines. Am I the only one seeing this issue?

The build works fine for me:

λ node -v
v4.2.3
λ npm -v
3.5.2
λ bower -v
1.7.7

image

Edit: generator-arcgis-js-app version 0.2.3

Thanks for testing @gavinr. That version of the generator are you on?

How about if you run bower install after running yeoman? I'm curious if something isn't getting installed right away after generating the app? I'll get an odd npm issue every once in a while.

I've tried that. I still see the same errors.

Also, I've had it where the bower install fails (which I found out from console errors when browsing to the app during grunt dev). I then re-ran bower install, all deps are installed, I can browse the app successfully, but then can't run grunt build or grunt release

Both npm start and npm run release work for me on a fresh install with the exception that I had to manually run bower install after generating my app.

It's odd you even had to do that. Yeoman should do them both after building the app via installDependencies
http://yeoman.io/authoring/dependencies.html

It could be something failed during install. I think what we could do is manually call the bower install, then the npm install in the generator on this line
https://github.com/odoe/generator-arcgis-js-app/blob/master/generators/app/index.js#L156

That should guarantee that bower runs before npm.

@odoe I've had a hard time getting installDependencies to work consistently before - I wasn't able to spend a lot of time figuring it out though. As a workaround in the past I've just included a grunt-shell task in my initialize task which runs bower install.

So I am all out of ammo on this one. I've tried on 3 diff machines (Win 7, Win 8, and OSX) w/ the latest (v0.2.4) and I get the same error.

I even went so far as to download a clean windows 7 (IE10) vm and install the latest NodeJS, Java, and git and then run:

npm install -g yo bower grunt-cli generator-arcgis-js-app
yo arcgis-js-app
npm start
npm run build

And I get the same error.

That should be reproducible by others if you've got an hour or two to watch installs crawl along.

Someone else told me they had a similar issue running the generator yesterday, so you're not totally jinxed @tomwayson. I still couldn't replicate, but I'm going to try something. I'll make a branch with a couple of small tweaks that you can test. I suspect it's just the installDependencies method mentioned above, I'll switch it to manually doing the npm/bower install.

@odoe

I'm glad you're jumping in here and I'll be happy to help test.

That said, I'm a little skeptical that it's related to installDependenceis b/c all the dependency files are there under the dist folder. For example, if you look at the first missing dependency from the build report above, module: esri/dijit/AppProxySettings; dependency: dgrid/OnDemandGrid, it's there:

image

And the contents of the file look valid:

define(["dojo/_base/declare", "./Grid", "./OnDemandList"], function(declare, Grid, OnDemandList){
    return declare("dgrid.OnDemandGrid", [Grid, OnDemandList], {});
});

It seems like more of an issue w/ the build being able to resolve the path.

I still couldn't replicate your issue, in Windows (8), Mac or Linux. If you try to use uglify on Windows, it could break, but not because of dependencies, because the api source has already been minified and it looks like uglify of uglify on Windows craps out on lots of files. Works fine everywhere else though. closure works across the board.

The rollup stuff could be interesting as a prebuild step though, so you could deploy an app.js and a vendor.js, which I have had trouble doing with layers in the Dojo build.

I'll check it out.

FYI - same error on brand new Mac machine w/ clean install of all the things (Node, Java, bower, yo, grunt-cli, etc).

Wayson. Out. 👐 🎤