mjohnston / react-native-webpack-server

Build React Native apps with Webpack
MIT License
933 stars 84 forks source link

TypeError: file.match is not a function #121

Closed niftylettuce closed 8 years ago

niftylettuce commented 8 years ago

Users/nexus/Public/foobar/Foobar/node_modules/react-native-webpack-server/node_modules/bluebird/js/main/async.js:43 fn = function () { throw arg; }; ^

TypeError: file.match is not a function at getPlatformExtension (/Users/nexus/Public/foobar/Foobar/node_modules/react-native/packager/react-packager/src/lib/getPlatformExtension.js:21:22)

at DependencyGraph._getRequestPlatform (/Users/nexus/Public/foobar/Foobar/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js:163:18)
at /Users/nexus/Public/foobar/Foobar/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js:140:23
at tryCallOne (/Users/nexus/Public/foobar/Foobar/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/nexus/Public/foobar/Foobar/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/Users/nexus/Public/foobar/Foobar/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at doNTCallback0 (node.js:408:9)
at process._tickCallback (node.js:337:13)

npm ERR! Darwin 14.5.0 npm ERR! argv "/Users/nexus/.nvm/versions/node/v4.1.2/bin/node" "/Users/nexus/.nvm/versions/node/v4.1.2/bin/npm" "run" "hot" npm ERR! node v4.1.2 npm ERR! npm v2.14.4 npm ERR! code ELIFECYCLE npm ERR! App@0.0.1 hot: HOT=1 react-native-webpack-server start --hot npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the App@0.0.1 hot script 'HOT=1 react-native-webpack-server start --hot'. npm ERR! This is most likely a problem with the App package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! HOT=1 react-native-webpack-server start --hot npm ERR! You can get their info via: npm ERR! npm owner ls App npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

niftylettuce commented 8 years ago

I'm on the 0.12-hmr

niftylettuce commented 8 years ago

These all happened after your rebase to master or whatever on this branch

ghost commented 8 years ago

+1 for some reason this just started happening for me with the 0.8.0 release, though it wasn't happening prior - leaving me believe it may possibly be a SemVer issue with the dependencies.

ghost commented 8 years ago

Quick update. Whatever I saw with 0.8.0 must've been on my side. Just did a clean react-native init and installed react-native-webpack-server along with the goods without issue.

niftylettuce commented 8 years ago

Is there any way we can write tests? On Nov 5, 2015 1:21 PM, "Josh Habdas" notifications@github.com wrote:

Quick update. Whatever I saw with 0.8.0 must've been on my side. Just did a clean react-native init and installed react-native-webpack-server along with the goods without issue.

— Reply to this email directly or view it on GitHub https://github.com/mjohnston/react-native-webpack-server/issues/121#issuecomment-154143916 .

ghost commented 8 years ago

The TDD landscape in JS/Node feels kinda shaky right now, what with tools like Jest getting a lot of flack from the community and things like AVA popping up seemingly overnight. But for some inspiration from the React community check this out: https://github.com/HSLdevcom/digitransit-ui. It uses tried and true Node test frameworks I know work and also uses the novel concept of literate business tests.

ghost commented 8 years ago

As for testing toolchains, it'd be nice to have a reporter capable of automatically kicking off a test-runner anytime a dependency or deep dependency changes - though that could get kinda gnarly when, by comparison, the effort of running the tests could be crowdsourced so those using the toolchains directly.

elliottsj commented 8 years ago

Hm ava looks pretty cool. I don't have much time to set up a test framework right now, but I'd be happy to accept a PR :smile:

Right now we're just running rnws bundle for the example projects on Travis, but we should have tests for:

We should probably also add to an example project: usage of 3rd-party RN module(s) like react-native-camera, and usage of static image assets.

As for dependency changes, greenkeeper could be useful. Thoughts?

ghost commented 8 years ago

Whoa! Good stuff. My only question is where does the sidewalk end? ^^

Back to the issue at hand, I was able to resolve my similar problem in the issue linked above. On Thu, Nov 5, 2015 at 1:10 PM Spencer Elliott notifications@github.com wrote:

Hm ava looks pretty cool. I don't have much time to set up a test framework right now, but I'd be happy to accept a PR [image: :smile:]

Right now we're just running rnws bundle for the example projects on Travis, but we should have tests for:

  • getReactNativeExternals.js: make sure it returns the expected modules
  • Launch rnws start (with various combinations of options), fetch each bundle and map file and assert that they match their expected value.
  • Run rnws bundle (with various combinations of options) and assert that the correct bundles are written to their expected file path.

We should probably also add to an example project: usage of 3rd-party RN module(s) like react-native-camera https://github.com/lwansbrough/react-native-camera, and usage of static image assets.

As for dependency changes, greenkeeper http://greenkeeper.io/ could be useful. Thoughts?

— Reply to this email directly or view it on GitHub https://github.com/mjohnston/react-native-webpack-server/issues/121#issuecomment-154156978 .

elliottsj commented 8 years ago

Cool. Yeah, I think the most important thing is to make sure nothing breaks due to dependency changes, so greenkeeper could be a good solution for that.

I'll create some new issues for this test-related stuff :+1: