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

[iOS] Can't get component to import on default boilerplate project #1339

Closed
deanc opened this issue Nov 21, 2018 · 3 comments
Closed

[iOS] Can't get component to import on default boilerplate project #1339

deanc opened this issue Nov 21, 2018 · 3 comments

Comments

@deanc
Copy link

deanc commented Nov 21, 2018

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
@deanc
Copy link
Author

deanc commented Nov 21, 2018

Seems this is directly related to this commit:
5e684d4

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

@cobarx
Copy link
Contributor

cobarx commented Nov 21, 2018

@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!

@mxmzb
Copy link

mxmzb commented Nov 21, 2018

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

@deanc deanc closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants