Coder Social home page Coder Social logo

Breaks icons in v6.2.0 about vector-icons HOT 27 CLOSED

expo avatar expo commented on May 22, 2024
Breaks icons in v6.2.0

from vector-icons.

Comments (27)

ShMcK avatar ShMcK commented on May 22, 2024 6

Thanks @brentvatne, for helping resolve my issue.

For anyone else with the same problem, it was a combination of two factors:

  1. I was using AppRegistry.registerComponent, which is no longer necessary. With CRNA you can also get away without calling registerComponent, as it assumes you are building whatever is the default export from "/ROOT/App.js". In short, @jayeszee nailed the problem.

  2. In my "app.json", I specified an "expo.appKey", which looked for the name of the registered component. With this specified, I couldn't remove registerComponent or the app would look for the registerComponent key, and fail to build.

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024 1

I have a similar babelrc. Could do coffee tomorrow, just send me a message on Twitter.

from vector-icons.

jayeszee avatar jayeszee commented on May 22, 2024 1

@brentvatne @ShMcK so i did a bit of digging and it seems like the error is due to the fact that my app which was created a while ago still used
AppRegistry.registerComponent which crna already does for us now. I went over and created a new crna app and just copied some of the initial configurations that differed like exporting my app instead of manually registering the component and now it seems to be happy.

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

error doesn't really make sense, nothing changed that would impact this. try updating again, should be fine. if not working, try clearing node_modules and installing again

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

oh -- are you using babel-preset-expo?

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

Yes, with some additional presets.

{
  "presets": [
    "babel-preset-expo",
    "react-native-dotenv"
  ],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source"
      ]
    }
  }
}

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

I've tried resetting modules, clearing the npm cache, etc. The only thing that worked was rolling back.

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

@ShMcK - any chance you can share your repo? or repro it on another repository?

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

Unfortunately, its private. I'll try to duplicate the issue in a separate repo.

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

thanks!

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

I created a smaller repo, but couldn't replicate the problem.

I'm certain the issue exists, at least for me alone, as changing back and forth from v6.2 to v6.1 recreates the issue.

Looking at the library commits, I'm also not sure what may have changed. And following the code within the node_modules, everything in Javascript land checks out


According to the "react-native-vector-icons" docs, when facing a similar error message, take the following steps. Unfortunately, none of these actions are available when using Expo.

Red screen with "Unrecognized font family" error on iOS

- Make sure you've added manually the reference of your .ttf on your xcodeproj Resources folder.
- Check that the font you are trying to use appears in Info.plist, if you've added the whole folder and it's blue in color, then you need to add it to the path.
- Check that the font is copied in the Copy Bundle Resources in Build Phases.
- Recompile the project.

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

@ShMcK - if you're unable to repro it on another project, the only thing we could do is have you send me your project and I can investigate. That said, it almost certainly has nothing to do with this library updating because the changes from 6.1 to 6.2 would not have impacted that, and it seems like a coincidence that changing versions causes this problem. There must be something else that is interacting in your project to cause the problem. If you need me to sign a NDA or whatever that's fine.

from vector-icons.

tobowers avatar tobowers commented on May 22, 2024

I have the same problem upgrading from 5.0.0 -> 6.2 I get 'unrecognized font family: material' but same error really.

Update: 6.1 is also broken for me. 5.2 works.

from vector-icons.

jayeszee avatar jayeszee commented on May 22, 2024

Me too! I upgraded from 5.1 to 6.2 and it broke.

Edit: looks like downgrading to 6.1 made it work...

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

@brentvatne, let me know if you'd like a hands on version to debug. Happy to comply :)

from vector-icons.

jayeszee avatar jayeszee commented on May 22, 2024

@brentvatne @ShMcK found the issue. its this 2f496ed reverting these 4 lines makes it work.

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

@ShMcK - haha that would be good! :) maybe grab a coffee and do this tomorrow?

@jayeszee @ShMcK - do you have babel-preset-expo in .babelrc?

from vector-icons.

jayeszee avatar jayeszee commented on May 22, 2024

@brentvatne
image

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

@jayeszee - can you share your app source with me?

from vector-icons.

jayeszee avatar jayeszee commented on May 22, 2024

@brentvatne sorry unfortunately I too am on a private repo =/ I can say that it does work on a fresh new crna app though.

from vector-icons.

brentvatne avatar brentvatne commented on May 22, 2024

I see! You should use Expo.registerRootComponent -- perhaps we need to give a warning if people register their applications through AppRegistry.registerComponent rather than Expo.registerRootComponent (which wraps the former in order to get rid of a redundant string argument in the first param and do some initialization work).

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

I haven't had the same success with AppRegistry.registerComponent.

Thanks @jayeszee, I'll try again tomorrow with your recipe of generating a new CRNA app and migrating the configuration over.

from vector-icons.

shamanking avatar shamanking commented on May 22, 2024

I have break it at version 6.3.1 and now, I can not fixed, because it's integrated in expo, version 27.0.1.
Any one can help me! Thank you!
screen shot 2018-05-14 at 4 20 32 pm

from vector-icons.

ShMcK avatar ShMcK commented on May 22, 2024

@shamanking, check the capitalization on ionicons. I believe it should be "Ionicons".

from vector-icons.

shamanking avatar shamanking commented on May 22, 2024

Thanks @ShMcK, I do it as @jayeszee and it works. My error arise when I detach expo to the exist project.

from vector-icons.

aleph-naught2tog avatar aleph-naught2tog commented on May 22, 2024

THANK YOU. I've been trying for ages. The trick was the registerRootComponent.

from vector-icons.

tuzmusic avatar tuzmusic commented on May 22, 2024

I'm pretty sure I started my project with expo init and have never needed to register components in any way. But the app won't run on an actual iOS device unless I add AppRegistry.registerComponent('main',() => App).

As noted, this causes the error with the Fonts (although the error doesn't appear on the device, it just shows no icons; in Expo the error can simply be

Using Expo.registerRootComponent (and main key in package.json) does indeed fix the Font problem, but then, without the AppRegistry line, I'm back to where I started and the app won't load on a device.

Is there a way to fix this?

from vector-icons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.