react helloworld-ts cannot run
Opened this issue · 0 comments
yangg commented
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: {},
},
],
},