start-ui-native icon indicating copy to clipboard operation
start-ui-native copied to clipboard

Find a way to be able to change config in real time

Open qlereboursBS opened this issue 2 years ago • 2 comments

Description

Currently, when I edit the local config and run a yarn set:env:local, it breaks (using Android at least), saying that:

error: Error: Unable to resolve module ../../../environment/config from /home/qlerebours/Projects/StartUI/start-ui-native/src/screens/Dev/About/index.js: 

None of these files exist:
  * src/environment/config(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * src/environment/config/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
> 1 | import React from 'react';
  2 | 
  3 | import { useNavigation } from '@react-navigation/core';
  4 | import {]

Then another bug occurs if I change the API_URL in the src/environement/config.js file: Cannot read property baseUrl of undefined.

Steps to reproduce (the second bug)

  • First fill the API_URL with an invalid URL
  • Validate it's invalid using the Network helper
  • Change the API_URL in the src/environement/config.js to make it valid
  • It breaks with the error message mentionned above

qlereboursBS avatar Oct 06 '21 15:10 qlereboursBS

environments/local is empty. run yarn set:env:dev

laogui avatar Jan 05 '22 04:01 laogui

Hello @laogui thanks for your help In fact, I already run the commands in the README.md that allows to copy what's in the dev config file into the local config file, so the local config file isn't empty What I'm saying with this issue, is that when you edit the config file, it won't be taken into account and will crash the app, you'll have to re-run the project. I want to find a way to make it dynamic, so that we can edit the config without having to start the project again :)

qlereboursBS avatar Jan 05 '22 08:01 qlereboursBS