React-native-video: [iOS] Can't get component to import on default boilerplate project

Created on 21 Nov 2018  路  3Comments  路  Source: react-native-video/react-native-video

Current behavior

Simply trying to import the library to use for the first time in the boilerplate AwesomeProject for react-native (non-expo version), I get the following error:

error: bundling failed: Error: Unable to resolve module `./FilterType` from `/Users/dc/Projects/AwesomeProject/node_modules/react-native-video/Video.js`: The module `./FilterType` could not be found from `/Users/dc/Projects/AwesomeProject/node_modules/react-native-video/Video.js`. Indeed, none of these files exist:
  * `/Users/dc/Projects/AwesomeProject/node_modules/react-native-video/FilterType(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/dc/Projects/AwesomeProject/node_modules/react-native-video/FilterType/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:120:15)
    at ResolutionRequest.resolveDependency (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:49:18)
    at DependencyGraph.resolveDependency (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/node-haste/DependencyGraph.js:219:16)
    at Object.resolve (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/lib/transformHelpers.js:141:30)
    at dependencies.map.result (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/DeltaBundler/traverseDependencies.js:373:31)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/DeltaBundler/traverseDependencies.js:369:18)
    at /Users/dc/Projects/AwesomeProject/node_modules/metro/src/DeltaBundler/traverseDependencies.js:188:33
    at Generator.next (<anonymous>)
    at step (/Users/dc/Projects/AwesomeProject/node_modules/metro/src/DeltaBundler/traverseDependencies.js:298:30)

Peeking inside node_modules/react-native-video reveals the FilterType.js file is not there.

Reproduction steps

  1. Install react-native
  2. Initialise the AwesomeProject project: react-native init AwesomeProject
  3. Install react-native video in the project root: npm install --save react-native-video; react-native link react-native-video
  4. Edit App.js to import react-native-video: import Video from 'react-native-video';
  5. Try and run the app through the simulator or a device: react-native run-ios

Expected behavior

I expect it to run and load the default application without issue.

Platform

  • iOS

Most helpful comment

@deanc Thanks for the heads up. I didn't even think to test the published package last night since the source tree was working.

I've pushed out 4.0.1 to fix this.

Sorry for the inconvenience everyone!

All 3 comments

Seems this is directly related to this commit:
https://github.com/react-native-community/react-native-video/commit/5e684d40c830edf4156219a0ed79fa650334e7c5

Which added FilterType.js, but package.json hasn't been updated so that this file is included in the files property. This needs quite an urgent fix @cobarx

@deanc Thanks for the heads up. I didn't even think to test the published package last night since the source tree was working.

I've pushed out 4.0.1 to fix this.

Sorry for the inconvenience everyone!

@cobarx it's aight, friend. we all do it ;) thanks for fixing so quickly, highly appreciate!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wang777777 picture wang777777  路  3Comments

Monte47 picture Monte47  路  3Comments

Chubacca picture Chubacca  路  3Comments

shahen94 picture shahen94  路  3Comments

rogerkerse picture rogerkerse  路  3Comments