lawrencec / Unroll

A helper tool to easily run the same tests against multiple data with verbose output.
16 stars 5 forks source link

1.5 fails build with "Error: StringMap expected string key" #35

Open Blackbaud-KevinHutson opened 7 years ago

Blackbaud-KevinHutson commented 7 years ago

@lawrencec Hey, I think there may be an issue with 1.5. Note that 1.4 seems to be working fine so it's not an emergency for us as I just pinned the version to 1.4.0.

This morning we kicked off a Jenkins build which runs our app that uses Unroll. package.json was set to ^1.1.0 so our build installed 1.5 and got the following.

abbreviated Jenkins console output:

unroll@1.5.0 node_modules/unroll

...later...
[661] ./~/unroll/index.js 42 bytes {0} [built] [1 error]
... and finally ...

ERROR in ./~/unroll/lib/unroll.js
Module build failed: Error: StringMap expected string key
    at stringmap.set (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/node_modules/stringmap/stringmap.js:99:19)
    at Scope.add (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/build/es5/scope.js:102:17)
    at /root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/build/es5/scopetools.js:38:25
    at Array.forEach (native)
    at createScopes (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/build/es5/scopetools.js:36:27)
    at visit (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:25:19)
    at visit (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
    at visit (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at traverse (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:56:5)
    at Object.setupScopeAndReferences (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/build/es5/scopetools.js:18:5)
    at ngAnnotate (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/node_modules/ng-annotate/build/es5/ng-annotate-main.js:1123:16)
    at Object.module.exports (/root/workspace/segmentation-component_build/node_modules/ng-annotate-loader/loader.js:68:24)
 @ ./~/unroll/index.js 1:17-40
05 09 2017 12:34:14.325:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
05 09 2017 12:34:14.334:INFO [launcher]: Starting browser PhantomJS
05 09 2017 12:34:15.122:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket KZI_32P4m5GY4UgkAAAA with id 53994316
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  Error: Cannot find module "./lib/unroll"
  at /root/workspace/segmentation-component_build/tests.webpack.conf.js:255299 <- webpack:///~/unroll/index.js:1:0

PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 0 ERROR (3.228 secs / 0 secs)

[12:34:18] 'test' errored after 2.12 min
[12:34:18] Error: 1
    at formatError (/root/.nvm/versions/node/v4.4.3/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/root/.nvm/versions/node/v4.4.3/lib/node_modules/gulp/bin/gulp.js:195:15)
    at emitOne (events.js:77:13)
    at Gulp.emit (events.js:169:7)
    at Gulp.Orchestrator._emitTaskDone (/root/workspace/segmentation-component_build/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
    at /root/workspace/segmentation-component_build/node_modules/gulp/node_modules/orchestrator/index.js:275:23
    at finish (/root/workspace/segmentation-component_build/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at cb (/root/workspace/segmentation-component_build/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
    at removeAllListeners (/root/workspace/segmentation-component_build/node_modules/karma/lib/server.js:336:7)
    at Server.<anonymous> (/root/workspace/segmentation-component_build/node_modules/karma/lib/server.js:347:9)
    at Server.g (events.js:260:16)
    at emitNone (events.js:72:20)
    at Server.emit (events.js:166:7)
    at emitCloseNT (net.js:1521:8)
    at nextTickCallbackWith1Arg (node.js:431:9)
    at process._tickCallback (node.js:353:17)
:jsTest FAILED
:jsTest took 165820ms

Let me know if I can provide more information that might be helpful to reproduce this issue. I might be able to lend some of my time to pinpoint the cause.

This is for an AngularJS (1.x) app using Gulp, Karma and Jasmine.

lawrencec commented 7 years ago

Hmmm, I'm having trouble replicating this. I suspect a transformation issue of some kind. Are you using babel?

Blackbaud-KevinHutson commented 7 years ago

Yep, we are using babel. Here is a dump our package.json if that's helpful.

{
  "name": "my-app",
  "version": "0.0.156",
  "repository": {
    "type": "git",
    "url": "private"
  },
  "scripts": {
    "build": "gulp build",
    "test": "gulp test"
  },
  "main": "src/main/index.js",
  "devDependencies": {
    "angular-mocks": "1.5.3",
    "angular-input-masks": "2.6.0",
    "autoprefixer": "^6.4.0",
    "babel": "^6.3.0",
    "babel-core": "~6.8.0",
    "babel-eslint": "^4.1.3",
    "babel-loader": "^6.2.4",
    "babel-plugin-istanbul": "^2.0.1",
    "babel-plugin-transform-es2015-classes": "^6.8.0",
    "babel-polyfill": "^6.8.0",
    "babel-preset-es2015": "^6.8.0",
    "babel-register": "~6.8.0",
    "chalk": "~1.1.1",
    "common-gulp": "~0.0.11",
    "common-ui-test": "~0.0.7",
    "css-loader": "^0.21.0",
    "del": "~2.2.0",
    "eslint": "^2.2.0",
    "eslint-loader": "^1.5.0",
    "eslint-plugin-angular": "~1.0.1",
    "eslint-plugin-jasmine": "^1.8.1",
    "filesaver.js-npm": "~1.0.1",
    "fs-extra": "^0.30.0",
    "gulp": "~3.9.0",
    "gulp-bump": "~2.1.0",
    "gulp-eslint": "~2.0.0",
    "gulp-filter": "~4.0.0",
    "gulp-git": "~1.7.0",
    "gulp-help": "~1.6.1",
    "gulp-rimraf": "^0.2.0",
    "gulp-tag-version": "~1.3.0",
    "gulp-tap": "^0.1.3",
    "gulp-util": "~3.0.6",
    "html-webpack-plugin": "^2.19.0",
    "istanbul": "~0.4.3",
    "istanbul-combine": "^0.3.0",
    "istanbul-instrumenter-loader": "^0.2.0",
    "jasmine": "^2.3.2",
    "jasmine-core": "^2.3.4",
    "jasmine-reporters": "^2.0.7",
    "js-yaml": "^3.5.3",
    "karma": "~0.13.9",
    "karma-chrome-launcher": "~1.0.1",
    "karma-cli": "^0.1.1",
    "karma-coverage": "~1.0.0",
    "karma-jasmine": "~1.0.2",
    "karma-junit-reporter": "^1.0.0",
    "karma-ng-html2js-preprocessor": "~1.0.0",
    "karma-phantomjs-launcher": "~1.0.0",
    "karma-sourcemap-loader": "^0.3.6",
    "karma-spec-reporter": "0.0.26",
    "karma-webpack": "^1.5.0",
    "nconf": "^0.8.4",
    "ng-annotate-loader": "0.1.0",
    "open-browser-webpack-plugin": "0.0.2",
    "opn": "^4.0.1",
    "phantomjs-prebuilt": "^2.1.3",
    "postcss-loader": "^0.10.1",
    "properties": "^1.2.1",
    "raw-loader": "^0.5.1",
    "require-linked-peer": "^0.1.0",
    "run-sequence": "~1.1.5",
    "sass-loader": "^3.0.0",
    "style-loader": "^0.13.0",
    "uglify-save-license": "~0.4.1",
    "unroll": "1.4.0",
    "url-loader": "^0.5.7",
    "webpack": "^1.8.4",
    "webpack-dev-server": "^1.12.1",
    "webpack-stream": "~3.2.0",
    "wrench": "~1.5.8",
    "yargs": "^4.7.1"
  },
  "engines": {
    "node": "~4.4.3"
  },
  "dependencies": {
    "angular-input-masks": "2.6.0"
  },
  "peerDependencies": {
    "blackbaud-skyux": "1.13.8",
    "lodash": "~4.12.0",
    "madlib-shim-easyxdm": "^2.4.20-7",
    "mixpanel-browser": "~2.7.2",
    "skyshell": "~0.0.1",
    "urijs": "^1.17.0",
    "rxjs": "~5.1.0"
  }
}

This apps is a little dated now. All of our new repo's are using the latest Angular now.

Blackbaud-KevinHutson commented 7 years ago

No rush on this. It isn't blocking us. We are pegged at 1.4 for now. If some time opens up we can test out 1.5, we can try it. I just wanted to let you know the error did exist for us at 1.5.

mreinstein commented 7 years ago

I'm also pegged @ 1.4.0, because 1.5.0 broke usage with all node versions < v6. unroll@1.5.0 really should have been unroll@2.0.0.