NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Unable to resolve mapPropsToStyleNames

Open jwoertink opened this issue 8 years ago • 19 comments

react-native, react and native-base version

    "native-base": "2.4.5",
    "react": "16.4.0",
    "react-native": "0.55.4",

Expected behaviour

No errors

Actual behaviour

Unable to resolve ../utils/mapPropsToStyleNames" from ".//node_modules/native-base/dist/src/basic/View.js`: The module `../utils/mapPropsToStyleNames` could not be found"

Steps to reproduce (code snippet or screenshot)

screen shot 2018-06-02 at 12 31 36 pm

Screenshot of emulator/device

Is the bug present in both ios and android or in any one of them?

Using iOS simulator. I haven't tried Android, but I would assume it happens there too.

Any other additional info which would help us debug the issue quicker.

Just booting the project from yarn start and I get this. Running on MacOS 10.13.4

jwoertink avatar Jun 02 '18 19:06 jwoertink

@jwoertink Try clearing cache before run npm start -- --reset-cache

#1856

SupriyaKalghatgi avatar Jun 04 '18 05:06 SupriyaKalghatgi

@SupriyaKalghatgi I tried that, but still get the same error. I even rm -rf node_modules then npm install and booted. I just renamed the directory in my node_modules/native-base to get my app to boot.

jwoertink avatar Jun 04 '18 15:06 jwoertink

@jwoertink Can you put your app on github or snack, for us to look into

SupriyaKalghatgi avatar Jun 05 '18 06:06 SupriyaKalghatgi

I can't push up the source, but maybe I can try and recreate a sample app. It might take me a bit, but I'll try and get something.

jwoertink avatar Jun 05 '18 15:06 jwoertink

I'm hitting the same issue. Upgraded from 2.4.2 to 2.4.5 and I have "Utils" not "utils" in my path, so getting same error:

The module `../utils/mapPropsToStyleNames` could not be found

Filesystem has:

./node_modules/native-base/dist/src/Utils/mapPropsToStyleNames.js
./node_modules/native-base/dist/src/Utils/mapPropsToStyleNames.js.map
./node_modules/native-base/src/Utils/mapPropsToStyleNames.js

I had to yarn remove native-base then yarn add native-base to get the proper file structure (utils). I think the upgrade from 2.4.2 to 2.4.5 just didn't rename the folder properly.

kodayashi avatar Jun 06 '18 04:06 kodayashi

you can rename folder from Utils to utils by yourself as temporary fix

54vanya avatar Jun 06 '18 10:06 54vanya

@54vanya That isn't necessary, since this issue was fixed long back

SupriyaKalghatgi avatar Jun 06 '18 10:06 SupriyaKalghatgi

@jwoertink Tried this?

SupriyaKalghatgi avatar Jun 08 '18 07:06 SupriyaKalghatgi

The renaming folder? That's what I had to do to get it to work. I haven't had a chance to do a mock app yet to recreate it. After digging in, I think it's something with cache, but using --reset-cache doesn't work. Possibly something between yarn and npm maybe? No clue

jwoertink avatar Jun 08 '18 15:06 jwoertink

@jwoertink Thousands of users using NativeBase with this version, no issues reported regarding this We tried helping you, asked you to create sample project for us to check and help you Anything else that you need from us?

SupriyaKalghatgi avatar Jun 11 '18 05:06 SupriyaKalghatgi

@SupriyaKalghatgi true, but @kodayashi also just reported this issue too. We can just close it out for now. If I get some free time, I'll try to re-create in a sample app and can always re-open later. Unless anyone else runs in to this issue and is able to re-create somehow. Thanks for the help!

jwoertink avatar Jun 11 '18 15:06 jwoertink

@jwoertink Thank you for cooperation We cant help anyone out, unless we are able to reproduce it, thats how it works

SupriyaKalghatgi avatar Jun 12 '18 02:06 SupriyaKalghatgi

almost similar to @kodayashi, I did upgrade from 2.4.2 to 2.5.2. @SupriyaKalghatgi perhaps you could reproduce this issue by install 2.4.2 and then upgrade it to latest version.

lonewolfffffff avatar Jun 20 '18 15:06 lonewolfffffff

In that case, @lonewolfffffff i will try to reproduce it by your way

SupriyaKalghatgi avatar Jun 20 '18 16:06 SupriyaKalghatgi

I had the same issue with a fresh install of native base. Only renaming the Utils folder to utils helped.

jan-happy avatar Jun 26 '18 10:06 jan-happy

Had the same issue. The issues seems to be present if you are running an old version of native-base definitely crops up in 2.4.2 for me. Just edit your package.json file to drop native-base. run yarn (or npm install), then run yard add native-base (or npm install --save native-base) to add it back, and it will install the latest version with all the fixes.

sakettawde avatar Jul 04 '18 04:07 sakettawde

I found a folder that named Utils in the node_modules/native-base/dist/src instead utils (they are different of letter case)

PMExtra avatar Jul 06 '18 10:07 PMExtra

I just ran into this issue when upgrading from 2.3 -> 2.8.1. I suspect it's an issue with npm or yarn caching modules because it was resolved when I wiped my npm cache then reinstalled 2.8.1.

crobinson42 avatar Nov 05 '18 18:11 crobinson42

Problem solved by rm -rf node_modules && yarn install.

Cache issue.

pedro-lb avatar Nov 05 '19 16:11 pedro-lb