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

TypeError on 5.7.0 #165

Closed
rusefendi opened this issue Dec 16, 2020 · 2 comments · Fixed by #166
Closed

TypeError on 5.7.0 #165

rusefendi opened this issue Dec 16, 2020 · 2 comments · Fixed by #166

Comments

@rusefendi
Copy link

rusefendi commented Dec 16, 2020

Node version: 14.15.1
OS: Mac OS 11

This code worked fine on 5.6.1, however on 5.7.0 I am having errors.

const base = {
      module: {
        rules: [
          {
            test: /\.s(a|c)ss$/,
            use: [
              {
                loader: "css-loader",
              },
              {
                loader: "sass-loader",
              },
            ],
          },
          {
            test: /\.(png|jpe?g|gif|svg)$/i,
            use: [
              {
                loader: "file-loader",
              },
            ],
          },
        ],
      },
    };
    const development = {
      module: {
        rules: [
          {
            test: /\.s(a|c)ss$/,
            use: ["style-loader"],
          },
        ],
      },
    };

mergeWithRules({
        module: {
          rules: {
            test: "match",
            use: "prepend",
          },
        },
      })(base, development)

Error message: TypeError: Cannot read property 'use' of undefined

@bebraw
Copy link
Member

bebraw commented Dec 16, 2020

Thanks for the report. It feels like a missing piece of logic (likely a missing test earlier). I'll check this one.

bebraw added a commit that referenced this issue Dec 16, 2020
@bebraw
Copy link
Member

bebraw commented Dec 16, 2020

Fixed in 5.7.1.

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

Successfully merging a pull request may close this issue.

2 participants