Jsx Runtime报错
node_modules/_@alife_ae-data-util@0.0.7-beta.1642998062985@@alife/ae-data-util/lib/hooks/medusa/index.js:10:28: error: Could not read from file: /Users/maoxunxing/alibaba/ae-seller-components/node_modules/.vite-plugin-externals/react.1a37f6a0.js/jsx-runtime
10 │ import { jsx as _jsx } from "react/jsx-runtime";
╵ ~~~~~~~~~~~~~~~~~~~
error when starting dev server:
Error: Build failed with 1 error:
node_modules/_@alife_ae-data-util@0.0.7-beta.1642998062985@@alife/ae-data-util/lib/hooks/medusa/index.js:10:28: error: Could not read from file: /Users/maoxunxing/alibaba/ae-seller-components/node_modules/.vite-plugin-externals/react.1a37f6a0.js/jsx-runtime
解决方案: 修改 tsconfig.ts
"compilerOptions": {
"baseUrl": ".",
"outDir": "./lib",
"module": "esnext",
"target": "es6",
"lib": ["esnext", "dom"],
"sourceMap": true,
"allowJs": false,
"jsx": "react", // change react-jsx to react
}
Be the first to know when I post cool stuff
Subscribe to get my latest posts by email.
Thanks for signing up! Check your email to confirm your subscription.
Whoops, we weren't able to process your signup.