Skip to content
This repository was archived by the owner on Jul 8, 2020. It is now read-only.
This repository was archived by the owner on Jul 8, 2020. It is now read-only.

Getting env vars during debugging in vs code #85

@superandrew

Description

@superandrew

Hi, I configured the package which is working when launching expo normally with expo r.

However when I try to launch the application using vs code debugger I catch this error because the main variable seems to end up being undefined.

Am I missing some crucial step or piece of information by expecting this to work?

import { ConfigContext, ExpoConfig } from "@expo/config/build";
import { mergeDeep } from "./utils/objectUtils";
import { TENANCY_NAME } from "react-native-dotenv";

export default ({ config }: ConfigContext): ExpoConfig => {
  try {
    let customConfig = require(`./tenant_configs/${TENANCY_NAME}.app.config.json`);
    if (!customConfig) {
      customConfig = {};
    }
    return mergeDeep({}, config, customConfig);
  } catch (e) {
    console.log(e);
    throw new Error(`Missing app configuration for tenant ${TENANCY_NAME}`);
  }
};


Result:

OS: darwin x64
Adapter node: v12.8.1 x64
vscode-chrome-debug-core: 6.8.8
Could not debug. Missing app configuration for tenant undefined

Ideas? Am I misusing react-native-dotenv?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions