Skip to content

react helloworld-ts cannot run #133

@yangg

Description

@yangg
ERROR in ./src/index.tsx
Module build failed (from ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.22.1_webpack@5.91.0/node_modules/babel-loader/lib/index.js):
ValidationError: Invalid configuration object. Babel loader has been initialized using a configuration object that does not match the API schema.
 - configuration should be an object:
   object { cacheDirectory?, cacheIdentifier?, cacheCompression?, customize?, … }

tried in yarn and pnpm,

resolved by add options: {} in webpack.config.js

 module: {
    rules: [
      {
        test: /\.(js|jsx|ts|tsx)$/,
        loader: "babel-loader",
        exclude: /node_modules/,
        include: /src/,
        sideEffects: false,
        options: {},
      },
    ],
  },

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