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

react-native-svg #51

Open
mementomoriCarpediem opened this issue Feb 24, 2024 · 1 comment
Open

react-native-svg #51

mementomoriCarpediem opened this issue Feb 24, 2024 · 1 comment
Assignees
Labels

Comments

@mementomoriCarpediem
Copy link

Package information

  • "react-native-svg": "^13.14.0",

Configuration

/**
 * @type {import("@react-native-esbuild/core").Config}
 */
exports.default = {
    logger: {
        timestamp: 'YYYY-MM-DD HH:mm:ss.SSS',
    },
    resolver: {},
    transformer: {
        fullyTransformPackageNames: [],
        stripFlowPackageNames: ['react-native-blob-util', 'react-native-fs'],
        additionalTransformRules: {
            babel: [
                {
                    test: (path, code) => {},
                    options: {},
                },
            ],
        },
    },
};

Additional context

  • I am using related libraries as listed below
    : "react-native-svg-transformer": "^1.1.0",
    :"@svgr/babel-plugin-transform-svg-component": "^8.0.0",

  • and in metro config. I set babelTransformerPath same as below.

 return mergeConfig(defaultConfig, {
        transformer: {
            getTransformOptions: async () => ({
                transform: {
                    experimentalImportSupport: false,
                    inlineRequires: false,
                },
            }),
            babelTransformerPath: require.resolve('react-native-svg-transformer'), 
        resolver: {
            assetExts: assetExts.filter((ext) => ext !== 'svg' && ext !== 'cjs'),
            sourceExts: [...sourceExts, 'svg', 'cjs'],
        },
    });
  • here is error shown when I execute bundle command.
스크린샷 2024-02-24 오후 8 40 50
@leegeunhyeok
Copy link
Owner

Sorry for the late response.

Since react-native-esbuild includes SVG transformation functionality by default, there is no need for a babel configuration.

Please check if the file extension is .svg, remove the babel svg configuration, and then verify. If the issue persists, please send the code required to reproduce the issue.

@leegeunhyeok leegeunhyeok self-assigned this Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants