-
-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Requiring ts-node in app.config.ts makes app crash #1170
Comments
Is this monorepo related?CI don't see how this is relevant to this repo. I suggest opening a support request at one of Expo's forums |
I assumed it is since the project works just fine outside the monorepo structure |
i still don't know what to register and where? it's a ts file, why do you even need to load ts-node? historically i've never gotten ts-node to work ootb for anything lol... |
Ugh I never want to use it either. I wish I never need to see "require" too. If you heard of the ignite template for native apps this is how their file looks like and it has ts-node imported. I am not really sure why but it is necessary to make the splashscreen (native module) plugin to work. I am trying to use the ignite template along with the turbo repo and here we are. |
@2Senn You can try using The issue with I have been trying for some time to figure out how to import values from packages in the monorepo, mainly to standardize constants like the url schema: Expo Config// app.config.ts
import "@swc-node/register";
// Or import "ts-node/register";
// Or import "tsx";
// Or import "tsx/esm";
// None seem to work
import type { ConfigContext, ExpoConfig } from "expo/config";
import {
ANDROID_IDENTIFIER,
IDENTIFIER,
IOS_IDENTIFIER,
TITLE,
} from "@acme/constants"; // TODO this doesn't work
// Error: Cannot access 'IDENTIFIER' before initialization
// Require hasn't really worked for me either.
export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: TITLE,
description: "", // TODO translations
slug: IDENTIFIER,
scheme: IDENTIFIER,
version: "0.1.0", // TODO: get from package.json
orientation: "portrait",
icon: "./assets/icon.png", // TODO shared assets?
userInterfaceStyle: "automatic",
splash: {
image: "./assets/icon.png",
resizeMode: "contain",
backgroundColor: "#1F104A", // TODO this
},
updates: {
fallbackToCacheTimeout: 0,
},
assetBundlePatterns: ["**/*"],
ios: {
bundleIdentifier: IOS_IDENTIFIER,
supportsTablet: true,
infoPlist: {
NSFaceIDUsageDescription: `Allow ${TITLE} to access your Face ID biometric data.`,
},
config: {
usesNonExemptEncryption: false,
},
},
android: {
package: ANDROID_IDENTIFIER,
adaptiveIcon: {
foregroundImage: "./assets/icon.png",
backgroundColor: "#1F104A",
},
},
experiments: {
tsconfigPaths: true,
typedRoutes: true,
reactCompiler: true,
},
plugins: [
"expo-router",
"expo-localization",
[
"expo-secure-store",
{
faceIDPermission: `Allow ${TITLE} to access your Face ID biometric data.`,
},
],
"react-native-webassembly",
"expo-sqlite",
],
}); I haven't had any luck getting this to work, and its unclear what is even wrong. I don't really want to write weird interop layers to get stuff like this to work, and I am hoping to go further and add translations to support publishing different descriptions based on the language of the user, but that will not work if I can't get this to work. |
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:
I need to import ts-node to be able to use the plugin but the app crashes when I do that with this error:
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
The text was updated successfully, but these errors were encountered: