English 中文(简体)
竞争失败者,出口申报必须达到模块顶级。
原标题:Compiling js failed, export declaration must be at top level of module

I ve Updated my react native app to the latest version and updated the expo from 45 to 50. When I run the npx expo command, Android bundled successful and then I can see the splash screen and then getting the following error. Please find the screenshot attached enter image description here Can anyone help me with this?

我更新了这些包裹,并在必要时更新到最新版本。 还是出现了同样的错误。

问题回答

我有这个问题。 我建议你审查你的巴贝尔案。

我的原信巴贝尔。

// babel.config.js
module.exports = function(api) {
  api.cache(true);
  return {
    presets: [
       babel-preset-expo ,
       @babel/preset-env ,
       @babel/preset-react ,
      //  @babel/preset-typescript , // Uncomment if using TypeScript
    ],
    plugins: [
      ["@babel/plugin-proposal-class-properties", { "loose": true }],
      ["@babel/plugin-transform-private-methods", { "loose": true }],
      ["@babel/plugin-transform-private-property-in-object", { "loose": true }],
       react-native-reanimated/plugin ,
    ],
  };
};

把这个问题改成下文似乎确定了问题:

// babel.config.js
module.exports = function(api) {
  api.cache(true);
  return {
    presets: [ babel-preset-expo ],
    plugins: [
      // Ensure  react-native-reanimated/plugin  is last
       react-native-reanimated/plugin ,
    ],
  };
};




相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签