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

When import file path contains CJK characters and dash will cause SyntaxError #730

Open
tychenjiajun opened this issue May 30, 2022 · 2 comments

Comments

@tychenjiajun
Copy link

🐛 Bug Report

import { ReactComponent as 图标 } from '@root/images/icons/图标-圆形.svg?component';

will cause

SyntaxError: unknown: Missing initializer in const declaration. (8:9)

   6 | }
   7 |
>  8 | const Svg- = ({

To Reproduce

Steps to reproduce the behavior:

Use the following webpack config

                test: /\.svg$/i,
                resourceQuery: /component/, // *.svg?component
                issuer: /\.[jt]sx?$/,
                use: [
                    {
                        loader: require.resolve('@svgr/webpack'),
                        options: {
                            titleProp: true,
                            typescript: true,
                            exportType: 'named',
                            svgo: true,
                            svgoConfig: require('../../svgo.webpack'),
                        },
                    },
                ]

and import some svg somewhere

import { ReactComponent as 图标 } from '@root/images/icons/图标-圆形.svg?component';

Expected behavior

No error.

Addtional info

This is actually a bug of camelcase. See sindresorhus/camelcase#98 sindresorhus/camelcase#99 will fix it.

@stale
Copy link

stale bot commented Oct 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 1, 2022
@stale stale bot closed this as completed Oct 16, 2022
@gregberge gregberge reopened this Oct 17, 2022
@stale stale bot removed the wontfix label Oct 17, 2022
@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants