Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve "./elements/Marker" - can somebody tell me what's wrong?

I have problem with my SVG Component. I think that I've did everything properly, but this after compiling I keep getting this error:

Unable to resolve "./elements/Marker" from "node_modules\react-native-svg\src\ReactNativeSVG.ts"
Failed building JavaScript bundle.

Can somebody check code that I provided below and tell me what's wrong? I'm currently working on latest Expo SDK and react-native-svg package. Ohh one more important thing to say.. I've tested it in Expo-Snack and it worked!

import React, { Component } from 'react';
import { View, StyleSheet, Dimensions } from 'react-native';
import Svg, { Defs, RadialGradient, Stop, G, Use, Path } from 'react-native-svg';

const { height, width } = Dimensions.get('window');

export default class SvgRadialBackground extends Component {
    render() {
        return (
            <View
                style={[
                    StyleSheet.absoluteFill,
                    { alignItems: 'center', justifyContent: 'center' },
                ]}>
                <Svg width={width} height={height}>
                    <Defs>
                        <RadialGradient
                            cx="50%"
                            cy="14%"
                            fx="50%"
                            fy="25%"
                            r="177%"
                            gradientTransform="matrix(0 .5 -1 0 .5 -0.146)"
                            id="prefix__b"
                        >
                            <Stop stopColor="#FFF" stopOpacity={0.5} offset="0%" />
                            <Stop stopColor="#003232" offset="100%" />
                        </RadialGradient>
                        <Path id="prefix__a" d="M0 0h375v667H0z" />
                    </Defs>
                    <G fill="none" fillRule="evenodd">
                        <Use fill="#244F77" xlinkHref="#prefix__a" />
                        <Use
                            fill="url(#prefix__b)"
                            style={{
                                mixBlendMode: 'soft-light',
                            }}
                            xlinkHref="#prefix__a"
                        />
                        <Use stroke="#979797" xlinkHref="#prefix__a" />
                    </G>
                </Svg>
            </View>
        );
    }
}
like image 228
Patryk Krawczuk Avatar asked Nov 25 '25 13:11

Patryk Krawczuk


1 Answers

I've figured it out.. This marker which cannot be resolved it's kinda new feature, they actually update package couple days ago. I've installed it using expo install.. and it didn't give me the latest version. Now I've updated it manually and it worked.

like image 70
Patryk Krawczuk Avatar answered Nov 27 '25 02:11

Patryk Krawczuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!