Skip to content

bug: Requiring ts-node in app.config.ts makes app crash #1170

Open
@2Senn

Description

@2Senn

Provide environment information

System:
OS: Linux 6.10 Fedora Linux 39 (KDE Plasma)
CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Memory: 9.34 GB / 15.47 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 20.12.0 - ~/.nvm/versions/node/v20.12.0/bin/node
npm: 10.8.3 - ~/.nvm/versions/node/v20.12.0/bin/npm
pnpm: 9.9.0 - ~/.local/share/pnpm/pnpm

Describe the bug

I have a custom plugin that I want to call in my app.config.ts like so:

// import "ts-node/register";

import type { ConfigContext, ExpoConfig } from "expo/config";

/**
 * @param config ExpoConfig coming from the static config app.json if it exists
 *
 * You can read more about Expo's Configuration Resolution Rules here:
 * https://docs.expo.dev/workflow/configuration/#configuration-resolution-rules
 */
module.exports = ({ config }: ConfigContext): Partial<ExpoConfig> => {
  const existingPlugins = config.plugins ?? [];

  return {
    ...config,
    plugins: [
      ...existingPlugins,
      require("./plugins/withSplashScreen").withSplashScreen,
    ],
  };
};

I need to import ts-node to be able to use the plugin but the app crashes when I do that with this error:

value.replace is not a function

What am i doing wrong?

Link to reproduction

just spin up a create t3 turbo app and install ts-node then try adding it to the app.config.ts

To reproduce

.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions