expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

Latest expo introduces a regression of #843

Open CodySwannGT opened this issue 2 years ago • 4 comments

Summary

This seems to be a direct reproduction of this: https://github.com/expo/expo-cli/issues/843

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.5
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
      Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn
      npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /Users/cody/.rvm/gems/ruby-3.0.2/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: 2020.3 AI-203.7717.56.2031.7935034
      Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ~0.16.2 => 0.16.27 
      expo: ^46.0.0 => 46.0.7 
      react: 18.0.0 => 18.0.0 
      react-dom: 18.0.0 => 18.0.0 
      react-native: 0.69.4 => 0.69.4 
      react-native-web: ~0.18.7 => 0.18.7 
    npmGlobalPackages:
      eas-cli: 0.60.0
      expo-cli: 6.0.2
    Expo Workflow: managed

Please specify your device/emulator/simulator platform, model and version

web

Error output

Uncaught TypeError: Cannot read properties of undefined (reading 'call')
    at l (bootstrap:79:22)
    at Module.<anonymous> (index.tsx:1:1)
    at l (bootstrap:79:22)
    at 1009 (app.4078bec3.chunk.js:1:235)
    at l (bootstrap:79:22)
    at Module.<anonymous> (2.5324c574.chunk.js:2:6358367)
    at l (bootstrap:79:22)
    at 1037 (app.4078bec3.chunk.js:1:751434)
    at l (bootstrap:79:22)
    at t (bootstrap:45:15)

Reproducible demo or steps to reproduce from a blank project

This started occurring after upgrading.

yarn start:web works fine, but when building with

yarn export:web we get the error above.

Rolling back @expo/webpack-config to ~0.16.2 from ^0.17.0 works around the issue and allows us to successfully run yarn export:web again.

For completeness sake, here is our webpack config:

const createExpoWebpackConfigAsync = require("@expo/webpack-config");
const { ExpoInterpolateHtmlPlugin } = require("@expo/webpack-config/plugins");
const { getPluginsByName } = require("@expo/webpack-config/utils");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = async function (env, argv) {
  // const config = await createExpoWebpackConfigAsync(env, argv);
  const config = await createExpoWebpackConfigAsync(
    {
      ...env,
      // offline: true,
      babel: {
        dangerouslyAddModulePathsToTranspile: ["@gorhom/bottom-sheet"],
      },
    },
    argv
  );

  const [plugin] = getPluginsByName(config, "HtmlWebpackPlugin");

  if (plugin) {
    const { options } = plugin.plugin;

    const newExpoInterpolateHtmlPlugin = ExpoInterpolateHtmlPlugin.fromEnv(
      env,
      HtmlWebpackPlugin
    );

    newExpoInterpolateHtmlPlugin.replacements = {
      ...newExpoInterpolateHtmlPlugin.replacements,
      STAGE: process.env.STAGE,
    };

    config.plugins.splice(plugin.index, 1, new HtmlWebpackPlugin(options));
    config.plugins.splice(plugin.index + 1, 1, newExpoInterpolateHtmlPlugin);
  }

  return config;
};

However, the error persisted even when using the default webpack file

CodySwannGT avatar Aug 16 '22 04:08 CodySwannGT

I am having the same issue after upgrading expo-cli to 6.0.2

ruida-shen avatar Aug 16 '22 22:08 ruida-shen

Just wanted to note, I had the same problem with an expo app deployed via AWS Amplify CI. I pinned the expo-cli version installed in the prebuild phase to 5.6.0 to work around it for now.

justro avatar Aug 20 '22 20:08 justro

@justro , thank you, it works for me also until we have a fix. best

jjborie avatar Aug 22 '22 16:08 jjborie

I was on expo-cli 6.0.5 and this is still happening. I downgraded to 5.6.0 as @justro suggested and it works.

amerikan avatar Sep 04 '22 01:09 amerikan

Having the same issue! For me downgrading expo-cli not working but downgrading @expo/webpack-config does

ebo7 avatar Sep 30 '22 17:09 ebo7

same here!

bearkfear avatar Oct 11 '22 01:10 bearkfear

Yeah, downgrading to "@expo/webpack-config": "0.16.27" worked for me.

jamesallain avatar Oct 25 '22 14:10 jamesallain

Is it fixed already?

erisvaldojunior avatar Nov 25 '22 17:11 erisvaldojunior

This is affecting my team as well. Downgrading @expo/webpack-config is a workaround for now.

shelmire avatar Feb 20 '23 13:02 shelmire

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] avatar May 21 '23 14:05 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

github-actions[bot] avatar May 28 '23 14:05 github-actions[bot]