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

An error occurs when applying react-refresh/babel in webpack5 #747

Open
zhengjunxiang opened this issue Apr 11, 2023 · 1 comment
Open

Comments

@zhengjunxiang
Copy link

zhengjunxiang commented Apr 11, 2023

Hello!

I'm having trouble using it.

env

Dependency Version
react 18.x
react-dom 18.x
react-refresh 0.10.0+
webpack 5.2.0+
@pmmmwh/react-refresh-webpack-plugin" 0.5.10

I used thread-loader and babel-loader in my project:

{
            name: constants_1.JS_MODULE_NAME,
            test: /\.(js|jsx|ts|tsx)$/,
            include: [path_1.default.resolve(projectDir, 'src')],
            use: [
                {
                    name: 'thread-loader',
                    loader: require.resolve('thread-loader'),
                },
                {
                    name: 'babel-loader',
                    loader: require.resolve('babel-loader'),
                    options: {
                        cacheDirectory: true,
                        presets: [
                            [
                                require.resolve('@babel/preset-env'),
                                {
                                    targets: constants_1.DEFAULT_BABEL_TARGETS,
                                    useBuiltIns: 'usage',
                                    corejs: '3',
                                },
                            ],
                            require.resolve('@babel/preset-react'),
                            require.resolve('@babel/preset-typescript'),
                        ],
                        plugins: [
                            [
                                require.resolve('@babel/plugin-proposal-decorators'),
                                {
                                    decoratorsBeforeExport: false,
                                },
                            ],
                            [
                                require.resolve('@babel/plugin-transform-runtime'),
                                {
                                    absoluteRuntime: path_1.default.dirname(require.resolve('@babel/runtime/package.json')),
                                },
                            ],
                            require.resolve('@babel/plugin-proposal-class-properties'),
                            require.resolve('@babel/plugin-syntax-dynamic-import'),
                        ],
                    },
                },
            ],
        }

The error message I received:
image

34045438625

Thank you!

@pmmmwh
Copy link
Owner

pmmmwh commented Apr 12, 2023

This error does not seem related to this package. Can you provide your full Webpack config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants