Skip to content
This repository was archived by the owner on Jul 14, 2023. It is now read-only.
This repository was archived by the owner on Jul 14, 2023. It is now read-only.

Intermittent loader issue: Module build failed . Expected '>', got 'value' #50

@passbyval

Description

@passbyval

Over the past week, swc-loader has begun intermittently throwing errors, and failing to build:

webpack:pid=857 Module build failed (from ../../node_modules/swc-loader/src/index.js):
webpack:pid=857 Error: 
webpack:pid=857   x Expected '>', got 'value'
webpack:pid=857     ,-[/app/packages/src/Accordion/index.tsx:80:5]
webpack:pid=857  80 | <AccordionContext.Provider value={contextValue}>
webpack:pid=857     :                            ^^^^^
webpack:pid=857     `----

This happens to all React components.

Loader config:

{
  test: /\.(tsx|mjs|ts)?$/,
  exclude: /(node_modules)/,
  use: [
    {
      loader: "swc-loader",
      options: {
        jsc: {
          parser: {
            syntax: "typescript"
          }
        }
      }
    }
  ]
}

Versions:

{
   "@swc/cli": "^0.1.57",
   "@swc/core": "^1.2.171",
   "@swc/jest": "^0.2.20",
   "swc-loader": "^0.2.0"
}

The weird thing is, one day it will work fine, but the next it starts breaking again with no changes.

Troubleshooting tried:

  • Removing and re-installing node_modules
  • Re-cloning the project
  • Upgrading @swc/core and @swc/cli to their latest versions

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