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

on travis nwb test-react fails with TypeError: Path must be a string received null #271

Closed
2 tasks
mcolburn opened this issue Feb 22, 2017 · 4 comments
Closed
2 tasks
Labels

Comments

@mcolburn
Copy link

This issue is a:

  • [] Bug report
  • Feature request
  • [X ] Question / support request
  • Other

The problem: nwb test runs fine in dev under Mac OS X. But, when the project is committed to git, and travis tests the build, it fails, complaining about a null path (see the output below).

What I have tried: the first time I encountered the problem, I tried setting my .travis.yml to use node 6 instead of 7. That fixed the problem then, but now it is broken again. All the tests pass when I run them on my dev machine.

I have searched on the Internet for people with a similar problem, but have not found any examples specific to nwb and travis. So, I am asking for help here. Is this perhaps an nwb bug?

My local versions are:

  • node v7.2.1
  • npm - v4.1.1
  • nwb - v0.15.6

My .travis.yml is:

sudo: false

language: node_js
node_js:
  - 6

cache:
  directories:
    - node_modules

before_install:
  - npm install codecov.io coveralls

after_success:
  - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
  - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

branches:
  only:
    - master

Here is the output from travis:

$ npm test

> ioc-liturgical-react@0.0.8 test /home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react
> nwb test-react

Error running command: Path must be a string. Received null
TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1431:5)
    at phantomJSExePath (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/karma-phantomjs-launcher/index.js:19:12)
    at Object.<anonymous> (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/karma-phantomjs-launcher/index.js:104:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getKarmaPluginConfig (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/nwb/lib/createKarmaConfig.js:144:18)
    at createKarmaConfig (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/nwb/lib/createKarmaConfig.js:164:31)
    at karmaServer (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/nwb/lib/karmaServer.js:25:53)
    at testReact (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/nwb/lib/commands/test-react.js:13:29)
    at cli (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/nwb/lib/cli.js:246:3)
    at Object.<anonymous> (/home/travis/build/OCMC-Translation-Projects/ioc-liturgical-react/node_modules/nwb/lib/bin/nwb.js:31:21)

My package.json:

{
  "name": "ioc-liturgical-react",
  "version": "0.0.8",
  "description": "ioc-liturgical-react React component",
  "main": "lib/index.js",
  "module": "es/index.js",
  "files": [
    "css",
    "es",
    "lib",
    "umd"
  ],
  "scripts": {
    "build": "nwb build-react-component",
    "clean": "nwb clean-module && npm clean-demo",
    "start": "nwb serve-react-demo",
    "test": "nwb test-react",
    "test:coverage": "nwb test-react --coverage",
    "test:watch": "nwb test-react --server",
    "postinstall": "echo 'done'"
  },
  "devDependencies": {
    "nwb": "0.15.6",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-markdown": "^2.4.4"
  },
  "dependencies": {
    "axios": "^0.15.3",
    "bootstrap": "^3.3.7",
    "file-loader": "^0.10.0",
    "font-awesome": "^4.7.0",
    "fs-extra": "^0.30.0",
    "fs-promise": "^0.5.0",
    "react-bootstrap": "0.30.7",
    "react-bootstrap-table": "2.7.1",
    "react-dom": "^15.4.2",
    "react-file-download": "^0.3.2",
    "react-fontawesome": "^1.5.0 ",
    "react-jsonschema-form": "^0.41.2",
    "react-select": "^1.0.0-rc.2",
    "svgo": "^0.7.1",
    "url-loader": "^0.5.7"
  },
  "peerDependencies": {
    "react": "15.4.2"
  },
  "author": {
    "name": "Michael Colburn",
    "email": "m.colburn@ocmc.org",
    "url": "ocmc.org"
  },
  "homepage": "",
  "license": "EPL-1.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/OCMC-Translation-Projects/ioc-liturgical-react.git"
  },
  "keywords": [
    "react-component",
    "liturgical",
    "Eastern Orthodox Christian",
    "ioc-liturgical-ws",
    "ioc-liturgical-db",
    "ioc-liturgical-react"
  ]
}

@insin
Copy link
Owner

insin commented Feb 22, 2017

Is there anything interesting in the npm install logs from your build? This looks like some sort of failure to install phantomjs-prebuilt.

@mcolburn
Copy link
Author

mcolburn commented Feb 22, 2017 via email

@mcolburn
Copy link
Author

I solved the problem by removing the following from my .travis.yml:

cache:
  directories:
    - node_modules

After this resulted in a successful build on Travis, I added the cache back in, and pushed to Git again. The build failed again. So, I removed the cache directive again, repushed, and the build passed.

For now, I will not use the cache directive in the .travis.yml.

It is unclear to me whether this is an issue regarding nwb. It doesn't seem to be. Do you want me to close it?

Thanks for your help!

@insin
Copy link
Owner

insin commented Feb 22, 2017

Thanks for reporting this - default node_modules/ caching will be removed from the project skeletons in the next release.

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

No branches or pull requests

2 participants