Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Latest expo introduces a regression of #843 #4517

Closed
CodySwannGT opened this issue Aug 16, 2022 · 11 comments
Closed

Latest expo introduces a regression of #843 #4517

CodySwannGT opened this issue Aug 16, 2022 · 11 comments
Labels
bug Something isn't working Platform: web Using Expo in the browser stale

Comments

@CodySwannGT
Copy link

Summary

This seems to be a direct reproduction of this: #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 CodySwannGT added the needs review Issue is ready to be reviewed by a maintainer label Aug 16, 2022
@ruida-shen
Copy link

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

@justro
Copy link

justro commented Aug 20, 2022

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.

@jjborie
Copy link

jjborie commented Aug 22, 2022

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

@amerikan
Copy link

amerikan commented Sep 4, 2022

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.

@ebo7
Copy link

ebo7 commented Sep 30, 2022

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

@bearkfear
Copy link

same here!

@jamesallain
Copy link

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

@EvanBacon EvanBacon added bug Something isn't working Platform: web Using Expo in the browser and removed needs review Issue is ready to be reviewed by a maintainer labels Oct 27, 2022
@erisvaldojunior
Copy link

Is it fixed already?

@shelmire
Copy link

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

@github-actions
Copy link

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 github-actions bot added the stale label May 21, 2023
@github-actions
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Platform: web Using Expo in the browser stale
Projects
None yet
Development

No branches or pull requests