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

Getting env vars during debugging in vs code #85

Open
superandrew opened this issue May 27, 2020 · 1 comment
Open

Getting env vars during debugging in vs code #85

superandrew opened this issue May 27, 2020 · 1 comment

Comments

@superandrew
Copy link

superandrew commented May 27, 2020

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?

@goatandsheep
Copy link

This package is deprecated for babel-plugin-dotenv-import

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants