Skip to content

Breaking change in micromatch 4 in ts-loader 5.4.6 #929

@pvtri96

Description

@pvtri96

Expected Behaviour

Everything should work fine because it is just a patch, not a breaking release.

Actual Behaviour

I am having this log when trying to upgrade to version 5.4.6

[root]\node_modules\ts-loader\node_modules\micromatch\index.js:44
    let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
                                                   ^^^

SyntaxError: Unexpected token ...

Steps to Reproduce the Problem

Here is my webpack.config.js

const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

module.exports = {
  resolve: {
    extensions: ['.ts', '.js'],
    plugins: [new TsconfigPathsPlugin({})],
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        exclude: [/node_modules/],
        use: [
          {
            loader: 'ts-loader',
          },
        ],
      },
    ],
  },
};

Location of a Minimal Repository that Demonstrates the Issue.

Refer to this PR: penta-jelly/re-radio#167

Follow these steps will produce this error

  • Checkout branch.
  • Run cd e2e
  • Run npm ci
  • Run npm run cypress:open
  • Open any test showing up in Cypress panel.
  • Then you can see the error log described above.

CI build result: https://circleci.com/gh/penta-jelly/re-radio/802

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions