Open cc-Listener opened 8 months ago
看下app.tsx里,import语句有问题
@sunnylqm
是不是默认的babel配置导致的问题 // babel-preset-taro 更多选项和默认值: // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md module.exports = { presets: [ ['taro', { framework: 'react', ts: true }] ] }
运行pushy bundle --platform android --entryFile ./src/app.tsx 报错信息如下 Bundling with react-native: 0.69.3 react-native-update-cli: 1.13.0 react-native-update: 9.1.6 Running bundle command: node node_modules/react-native/local-cli/cli.js bundle --assets-dest .pushy/intermedia/android --bundle-output .pushy/intermedia/android/index.bundlejs --dev false --entry-file ./src/app.tsx --platform android --reset-cache warn Package @ant-design/icons-react-native contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. warn Package @ant-design/react-native contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. warning: the transform cache was reset. Welcome to Metro! Fast - Scalable - Integrated error src/app.tsx: Import statement may only appear at top level in file src/app.tsx at 4:2. Error: Import statement may only appear at top level in file src/app.tsx at 4:2 at minifyCode (/xx/node_modules/metro-transform-worker/src/index.js:101:13) at transformJS (/xx/node_modules/metro-transform-worker/src/index.js:319:28) at transformJSWithBabel (/xx/node_modules/metro-transform-worker/src/index.js:410:16) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (/xx/node_modules/metro-transform-worker/src/index.js:571:12) info Run CLI with --verbose flag for more details. Error: "react-native bundle" command exited with code 1. at ChildProcess. (/.nvm/versions/node/v16.17.0/lib/node_modules/react-native-update-cli/lib/bundle.js:83:16)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1093:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)