사용법은 간단하고 다른곳 문서, 설명도 많으니 여기선 생략 합니다.

 

---

 

next-nprogress-bar 로 로딩 이미지를 보여주고 있었는데 어느 순간 안되기 시작.

progressbar dom 은 추가되는데 스타일이 안먹는 것 보고 확인해봄

 

next-nprogress-bar 코드 일부

next-nprogress-bar 에서는 #nprogress 즉 id 를 이용해서 스타일을 먹이고 있음.

 

next-nprogress-bar 에서 사용중인 라이브러리 nprogress-v2 코드를 보러가자

nprogress-v2

 

엥 여기는 클래스 이름으로 nprogress 를 먹이고 있음. 근데 예전엔 잘 됐었는데? 싶어서 이전 버전을 보러감

1.0.4 버전이 다운로드수가 제일 많아서 그냥 바로 1.0.4 보러감

 

 

원래는 id 로 nprogress 를 주고 있었음...

버전 업데이트 하면서 id -> classname 으로 변경하면서 기존 라이브러리가 작동 안함

 

해결방법은 next-nprogress-bar 개발자가 해결해주거나 수정해서 MR 날리거나.. 그런데 이게 언제 고쳐질지 모른다

현재 사용중인 프로젝트에서 해결해보자

 

package.json

package.json

resolutions 필드에 "next-nprogress-bar/nprogress-v2" : "1.0.4" 를 추가해준다.

해당 라이브러리의 디펜던시의 버전을 오버라이드 할 수 있다.

다시 설치해봄

 

bun i

 

ㅋㅋ; bun 은 아직 중첩 resolutions 을 지원 안한다고 한다;

 

yarn install

 

yarn 으로 설치함

 

 

음 잘 뜬다

새로운 맥에서 ios 실기기 빌드하는데 해당 에러가 뜨면서 앱이 하얀화면에서 멈춰있었다.

 

[VERBOSE-2:FlutterObservatoryPublisher.mm(101)] Failed to register observatory port with mDNS with error -65555.
[VERBOSE-2:FlutterObservatoryPublisher.mm(103)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartobservatory._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations. For more information, see https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions
Connecting to the VM Service is taking longer than expected...
Still attempting to connect to the VM Service...
If you do NOT see the Flutter application running, it might have crashed. The device logs (e.g. from adb or XCode) might have more details.
If you do see the Flutter application running on the device, try re-running with --host-vmservice-port to use a specific port known to be available.

로그는 이정도

 

해결방법은 "시스템 환경설정" 에서

 

 

 

 

그리고 다시 빌드를 하면 잘 된다

nextjs에서 useEffect가 아무리봐도 2번 실행시킬 코드가 아닌데 자꾸 2번 실행돼서 찾아봤다.

자꾸 2번 실행된다

 

next.config.js 에서  reactStrictMode 를 false 로 변경하고 앱을 재실행하자.

[ Found a change in next.config.js. Restart the server to see the changes in effect. ]

const nextConfig = {
  reactStrictMode: false,
}

 

됐다

 

https://stackoverflow.com/questions/71835580/useeffect-being-called-twice-in-nextjs-typescript-app

 

useEffect being called twice in Nextjs Typescript app

I have a simple useEffect function setup with the brackets like so: useEffect(() => { console.log('hello') getTransactions() }, []) However when I run my app, it prints two hellos i...

stackoverflow.com

 

Xcode's output:
↳
Writing result bundle at path:
/var/folders/mw/s87p0r9j4cnbnl0pbskz815h0000gp/T/flutter_tools.NCX2rj/flutter_ios_build_temp_dirpXAxz0/temporary_xcresult_bundle
: Error: Member not found: 'UnicodeChar'.
../…/src/structs.g.dart:661


int get UnicodeChar => Char.UnicodeChar;
^^^^^^^^^^^
: Error: Setter not found: 'UnicodeChar'.
../…/src/structs.g.dart:662
set UnicodeChar(int value) => Char.UnicodeChar = value;
^^^^^^^^^^^
: Error: Member not found: 'AsciiChar'.
../…/src/structs.g.dart:664
int get AsciiChar => Char.AsciiChar;
^^^^^^^^^
: Error: Setter not found: 'AsciiChar'.
../…/src/structs.g.dart:665
set AsciiChar(int value) => Char.AsciiChar = value;
^^^^^^^^^
Failed to package /Users/mik_a/Desktop/dev/app.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/mw/s87p0r9j4cnbnl0pbskz815h0000gp/T/flutter_tools.NCX2rj/flutter_ios_build_temp_dirpXAxz0/temporary_xcresult_bundle

 

Flutter 3.0 업데이트 후 iOS 빌드를 하려고 하니 나온 에러.

해결법

 

flutter pub upgrade --major-versions // 현재 프로젝트의 패키지 버전을 최신버전으로 업그레이드
flutter clean
rm pubspec.lock // pubspec.lock 파일 삭제
flutter pub get

 

개발하다보면 값을 확인하기위해 print 로 확인하는 경우가 많다.

그런데 Avoid 'print' calls in production code. 가 뜨면서 사용을 권장하지 않는다. 이유가 뭘까

 

일단 이 경고가 뜨는건 flutter 2.3.0 이후로 추가된 flutter_lints 패키지의 영향이다.

간단하게, flutter 에서 권장하는 문법으로 코딩하게 조언해주는 패키지다 

 

pubspec.yaml

pubspec.yaml 파일에 가보면 이렇게 패키지가 등록되어있을텐데 삭제하면 이 경고는 더 이상 뜨지 않는다.

 

경고를 해주는 이유는

print() 는 release 모드로 빌드해도 logcat 등에 그대로 출력된다.

만약 사용자에게 숨겨야하거나 민감한 내용을 print 를 삭제하지 않아서 로그에 그대로 나오게 된다면 문제가 생길수도 있다.

 

그래서 대신 debugPrint() 혹은 log() 를 권장한다. ( log를 더 권장하던데 하나의 글에서 본거라 확실치 않아서 나중에 더 찾아볼 예정)

 

다만... log는 developer 를 import 해줘야하고 debugPrint 는 길어서 그런가.. 잘 안쓰게된다.

상황에 맞게 잘 쓰도록하자

+ Recent posts