#module

질문 1
해시태그 없이 키워드만 일치하는 질문은 개수에 포함되지 않아요.

8달 전 · 노원재 님의 질문 업데이트

ReactNative Xcode 16. RCTAppDelegate.h not find

안녕하세요? 에러로 고통받다가 커리어리에 남겨봅니다. ReactNative 프로젝트로 테스트플라이트 배포상태에서 3주가 지나 지난주 Xcode 16으로 업데이트 되었는데요. 그 뒤 ios 버전, 라이브러리 버전 문제는 해결했는데. Xcode 에서 build /ios/프로젝트명/AppDelegate.h 파일에서 #import <RCTAppDelegate.h> 파일을 찾을 수 없다고 나옵니다. 사양 1. M2, Sequoia 2. react-native : 0.74.3 3. Xcode 16.1 문제 해결을 위해 시도한 방법 입니다. 1. #import <React/RCTAppDelegate.h> 바꿔봄 2. #import "AppDelegate.h" 바꿔봄 3. node_module/react-native/React/Base/에서 헤더파일 찾아봄 -> 없음 4. node_module/react-native/ReactCommon/에서 헤더파일 찾아봄 -> 없음 5. 대체할 수 있는 방법 찾아봄 GPT에서 제안한 방법으로 수정 -> 결과 : 파일 찾을 수 없음 #import <UIKit/UIKit.h> #import <React/RCTBridgeDelegate.h> @interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate> @property (nonatomic, strong) UIWindow *window; @end 6. Xcode에서 경로를 추가해봄 -> 결과 : 파일 찾을 수 없음 6-1. Xcode > BuildSetting > search header 에 경로를 추가했습니다. "$(SRCROOT)/../node_modules/react-native/React", "$(SRCROOT)/../node_modules/react-native/ReactCommon", "$(SRCROOT)/../node_modules/react-native/ReactCommon/cxxreact", "$(SRCROOT)/../node_modules/react-native/Libraries", 6-2. Xcode > BuildSetting > Frame search header에 경로를 추가했습니다. "$(inherited)", "$(SRCROOT)/../node_modules/react-native/React", "$(SRCROOT)/../node_modules/react-native/ReactCommon", 7. pod 재설치, react-native 재설치, 캐시 삭제 및 라이브러리 업데이트 등.. pod.lock, Podfile, node_module, build 파일, DerivedData 폴더 삭제 후 전부 재설치. pod install --repo-update 헤르메스 사용 설정 및 use_frameworks! :linkage => :static 설정 확인. 8. react-native 최신버전(0.76.3)으로 재설치 참고 사이트 및 GPT, Monica 질의응답 공유 링크 https://github.com/facebook/react-native/issues/36611 https://stackoverflow.com/questions/75822104/rctappdelegate-h-file-not-found https://chatgpt.com/share/674e6dcf-89f8-800f-b0e6-4fa2fe58419b https://monica.im/share/chat?shareId=CQ18cvvPvsMc0r3U ** 유의미한 정보를 주신분께 감사의 마음으로 많지는 않지만 스타벅스 커피쿠폰을 드립니다 살려주세요..

개발자

#reactnative-run-ios

#xcode

#appdelegate.h

답변 0

댓글 0

조회 247

9달 전 · 유길종 님의 답변 업데이트

Nextjs with tailwind기반 ui라이브러리 질문

프론트엔드 취업전인 학생입니다. Rollup으로 라이브러리 번들 관련하여 질문입니다. 제작 현시점은 사용자가 컴포넌트를 import 하였을때 사용자가 tailwind.config.ts에 node_module경로의 제 라이브러리를 경로를 설정해야 스타일이 적용이 되는상황입니다. 개발자도구 element에는 텍스트상 적용이돼있는데 해당 방법말고는 못찾았습니다. 개발자분들의 좋은의견 부탁드립니다. 아래는 현재 rollup.config.js입니다.

개발자

#next.js

#react

#tailwindcss

#rollup

#library

답변 1

댓글 0

보충이 필요해요 1

조회 80

10달 전 · 노원재 님의 답변 업데이트

ReactNative ios build 에러 3일째 해결을 못했습니다.

시뮬레이션을 실행하려고 해도 스크립트 문제, iPhone 버전 범위 문제, 시뮬레이터 문제가 계속 발생합니다. 어떤 도움이라도 감사합니다. ReactNative를 처음 접했습니다. 저희 팀에서 저를 도울 수 있는 사람이 없습니다. #프로젝트 환경 mac M2 ruby -v ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23] node -v v20.10.0 pod --version 1.15.2 package.json { "name": "labts", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "@react-native-community/async-storage": "^1.12.1", "@react-native-community/cli": "13.6.9", "@react-navigation/bottom-tabs": "^6.6.0", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.10.0", "@tanstack/react-query": "^5.51.5", "@types/react-native-vector-icons": "^6.4.18", "axios": "^1.7.2", "date-fns": "^3.6.0", "immer": "^10.1.1", "react": "18.2.0", "react-native": "0.74.3", "react-native-calendars": "^1.1305.0", "react-native-date-picker": "^5.0.4", "react-native-dotenv": "^3.4.11", "react-native-get-random-values": "^1.11.0", "react-native-image-crop-picker": "^0.41.2", "react-native-image-zoom-viewer": "^3.0.1", "react-native-paper": "^5.12.3", "react-native-permissions": "^4.1.5", "react-native-safe-area-context": "^4.10.8", "react-native-screens": "^3.32.0", "react-native-splash-screen": "^3.3.0", "react-native-tab-view": "^3.5.2", "react-native-vector-icons": "^10.1.0", "react-native-vision-camera": "^4.5.1", "uuid": "^10.0.0", "yarn": "^1.22.22" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.74.85", "@react-native/eslint-config": "0.74.85", "@react-native/metro-config": "0.74.85", "@react-native/typescript-config": "0.74.85", "@types/react": "^18.2.6", "@types/react-native-dotenv": "^0.2.2", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "babel-plugin-module-resolver": "^5.0.2", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" } } PodFile require Pod::Executable.execute_command('node', ['-p', 'require.resolve( "react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]}, )', __dir__]).strip platform :ios, '12.0' use_frameworks! #use_modular_headers! prepare_react_native_project! linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end target 'nexlabts' do config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'nexlabtsTests' do inherit! :complete # Pods for testing end post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false, # :ccache_enabled => true ) end end 제가 아래 에러 3가지에 대해 제가 해본 방법들입니다. 1. node 재설치 node_module 폴더 삭제, package-rock.json 삭제 후 재설치 npm install --legacy-peer-deps yarn install 2. Xcode가 node 읽을 수 있도록 설정 sudo ln -s "$(which node)" /usr/local/bin/node 3. Podfile 내 platform 설정 수정 platform :ios, '12.0' or platform :ios, '14.0' 4. Pods 재설치 rm -rf ~/Library/Developer/Xcode/DerivedData or rm -rf ~/Library/Developer/Xcode/DerivedData/* rm -rf Pods rm Podfile.lock pod install --repo-update Xcode \> Product \> Clean Build Folder. cd ./ios pod cache clean -all pod install --repo-update cd ../ npx react-native run-ios --no-packager --simulator="iPhone 15" or npx react-native run-ios --simulator="iPhone 15" or yarn start > i(run ios) Err 1. cocoaPods 설치할 때 [!] CocoaPods could not find compatible versions for pod "React-RuntimeHermes": In Podfile: React-RuntimeHermes (from ../node_modules/react-native/ReactCommon/react/runtime) Specs satisfying the React-RuntimeHermes (from ../node_modules/react-native/ReactCommon/react/runtime) dependency were found, but they required a higher minimum deployment target. Err2. iOS 실행할때 run-ios --no-packager --simulator="iPhone 15" Build description signature: fc1341421f84b87c5245d346c2c17b66 Build description path: /Users/nowonjae/Library/Developer/Xcode/DerivedData/nexlabts-argvodqcybjfcybstpulfpghnzvm/Build/Intermediates.noindex/XCBuildData/fc1341421f84b87c5245d346c2c17b66.xcbuilddata /Users/nowonjae/Desktop/project/NeXLabRN/ios/nexlabts.xcodeproj:1:1: error: Unable to open base configuration reference file '/Users/nowonjae/Desktop/project/NeXLabRN/ios/Pods/Target Support Files/Pods-nexlabts/Pods-nexlabts.release.xcconfig'. (in target 'nexlabts' from project 'nexlabts') warning: Unable to read contents of XCFileList '/Target Support Files/Pods-nexlabts/Pods-nexlabts-resources-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') warning: Unable to read contents of XCFileList '/Target Support Files/Pods-nexlabts/Pods-nexlabts-frameworks-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-frameworks-Release-input-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-frameworks-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'nexlabts' from project 'nexlabts') warning: Run script build phase '[CP] Embed Pods Frameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-resources-Release-input-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-resources-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') warning: Run script build phase '[CP] Copy Pods Resources' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'nexlabts' from project 'nexlabts') --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS Simulator, id:B5AA2E84-4F83-4749-A986-A1FCE5E398A3, OS:17.5, name:iPhone 15 } { platform:iOS Simulator, id:B5AA2E84-4F83-4749-A986-A1FCE5E398A3, OS:17.5, name:iPhone 15 } ** BUILD FAILED ** ] Err3. Xcode 로 Build 할때 (Any iOS Simulator Device (arm64, x86_64)) Command PhaseScriptExecution failed with a nonzero exit code

개발자

#reactnative

#xcode

#reactnative-run-ios

답변 1

댓글 0

조회 581

일 년 전 · 석정도 님의 질문

리액트 네이티브 릴리즈로 배포 시 build.gradle 설정대로 동작 안하는 이유가 뭔지 궁긍합니다.

안녕하세요. 현재 리액트 네이티브로 프로젝트를 진행하고 있습니다. 막바지 단계에 거의 도달해서 이제 배포 준비를 하려고 하는데요, 마지막으로 테스트를 하기 위해 stagingRelease 로 apk 를 만들어서 테스트를 하려고 하니, .env.staging 을 읽지를 못하고 있네요. 이상한건 stagingDebug 로 할 때에는 이런 문제가 없었습니다. 지금 환경변수는 루트 디렉토리에 env 폴더가 있고, 해당 폴더 내에는 3개의 환경변수 파일이 존재합니다. .env.development .env.staging .env.production 이렇게 3개 입니다. project.ext.envConfigFiles = [ productiondebug: "env/.env.production", productionrelease: "env/.env.production", developmentrelease: "env/.env.development", developmentdebug: "env/.env.development", stagingrelease: "env/.env.staging", stagingdebug: "env/.env.staging" ] 위의 코드는 제가 설정한 환경변수 매핑하는 부분입니다. 실제로 stagingrelease 로 빌드 시에 flavor 값이 stagingrelease 로 뜨는 걸 확인했습니다. node_modules 에서 react-native-config 폴더를 찾아서 dotenv.gradle 에서 찍으니까 확인이 가능하더라고요. 제가 궁금한 점은 왜 루트에서 .env 파일만을 읽어서 BuildConfig.java 에서 사용하려고 하는걸까요? .env.staging 을 참조하지 않는 이유가 궁금합니다. 아래는 dotenv.gradle 파일입니다. import java.util.regex.Matcher import java.util.regex.Pattern def getCurrentFlavor() { Gradle gradle = getGradle() def pattern = Pattern.compile("(?:.*:)*[a-z]+([A-Z][A-Za-z0-9]+)") def flavor = "" gradle.getStartParameter().getTaskNames().any { name -> Matcher matcher = pattern.matcher(name) if (matcher.find()) { flavor = matcher.group(1).toLowerCase() return true } } println "Current flavor: $flavor" return flavor } def loadDotEnv(flavor = getCurrentFlavor()) { def envFile = project.hasProperty("defaultEnvFile") ? project.defaultEnvFile : ".env" if (System.env['ENVFILE']) { envFile = System.env['ENVFILE'] } else if (System.getProperty('ENVFILE')) { envFile = System.getProperty('ENVFILE') } else if (project.hasProperty("envConfigFiles")) { project.ext.envConfigFiles.any { pair -> if (flavor.startsWith(pair.key.toLowerCase())) { envFile = pair.value return true } } } println "Reading env from: $envFile" def env = [:] File f = new File("$project.rootDir/../$envFile"); if (!f.exists()) { f = new File("$envFile"); } if (f.exists()) { println "Found env file: $f" f.eachLine { line -> def matcher = (line =~ /^\s*(?:export\s+|)([\w\d\.\-_]+)\s*=\s*['"]?(.*?)?['"]?\s*$/) if (matcher.getCount() == 1 && matcher[0].size() == 3) { env.put(matcher[0][1], matcher[0][2].replace('"', '\\"')) // 각 환경 변수 키-값 쌍 출력 println "Loaded env variable: ${matcher[0][1]} = ${matcher[0][2]}" } } } else { println("**************************") println("*** Missing .env file ****") println("**************************") } project.ext.set("env", env) } loadDotEnv() android { defaultConfig { project.env.each { k, v -> def escaped = v.replaceAll("%","\\\\u0025") buildConfigField "String", k, "\"$v\"" resValue "string", k, "\"$escaped\"" println "Set buildConfigField and resValue: $k = $v" } } } 안드로이드 스튜디오 터미널에서 ./gradlew assembleStagingRelease 명령어를 치게 될 경우, Current flavor: stagingrelease Reading env from: .env.staging ************************** *** Missing .env file **** ************************** 이런 로그가 뜨고 있습니다.

개발자

#react-native

#react-native-config

#다중환경변수

#release

답변 0

댓글 0

조회 74

일 년 전 · 성지수 님의 질문

micro repo 세팅하면서 격은 문제(같은 문제 격는 분들 댁글)

이번 프로젝트에서 하나의 레포지토리에서 client, server, admin, common 4가지 패키지를 만들었습니다. client, server, admin은 common을 의존하도록 모노레포로 만들었고, client는 admin을 의존할 수 있게 micro로 만들었습니다. 간단한 패키지 설명: - client: 메뉴 헤더 등 구현, 페이지는 admin을 remote 해서 사용, React로 구현 - admin: 페이지에 나오는 콘텐츠의 전반적인 부분이 컴포넌트로 되어있음, React로 구현 - server: Node.js로 되어있고 실제 Spring 서버에서 준 데이터를 포맷하는 형태 - common: 공통 컴포넌트, 라벨 등 문제1: 다른 프로젝트에서 expose 되어있는 Next.js 프로젝트(scss로 스타일 구현)를 client에서 사용할 때 의존성 관련 오류가 생깁니다. client의 package.json에서 peerDependencies로 next를 설정해줘야 하는지, 양쪽 패키지(다른 프로젝트와 client)에서 Next.js와 React를 share 설정을 해야 되는지 잘 모르겠습니다. 여러 방법으로 시도는 해봤지만 의존성 오류나 Next.js에서 훅을 사용 못하는 오류 때문에 해결하지 못하고 있습니다. 문제2: 빌드 최적화를 위해 트리쉐이킹이나 코드 스플리팅을 해야 합니다. 웹팩에서 아래와 같이 코드 스플리팅을 하면 청크 파일 이름이 겹치기 때문에 filename을 해시값으로 설정해야 합니다. 여기서 문제가 생기는데, micro의 client처럼 remote 하는 부분에서 remote.js, app.js 청크가 필요하기 때문에 이름이 해시값으로 바뀌면 해당 청크를 찾을 수 없습니다. 또한 ModuleFederationPlugin이 빌드 시 자동으로 코드 스플리팅을 해준다는 이야기도 있는데, 이 부분은 정확하지 않습니다. 저와 같은 문제를 격고 있거나 해결하신 분들 같이 나눴으면 합니다.

개발자

#micro

#react

#monorepo

#nextjs

#build

답변 0

댓글 0

조회 37

일 년 전 · 성지수 님의 질문 업데이트

마이크로 프론트 구현(Nextjs, React)

요구사항 마이크로 프론트엔드로 A라는 프로젝트에서 B라는 프로젝트의 컴포넌트를 사용하고 싶다 프로젝트 설명 ModuleFederationPlugin 사용해서 expose remote 설정 A 프로젝트 (remote) : react, styled-component 사용 B 프로젝트 (expose) : nextjs, scss 사용 첫번째 오류 styled 이 달라서 nextjs 에서 노드가 불러와지지 않는 것 해결 : <noscript id="**next_css__DO_NOT_USE**"></noscript> → 두번째 오류 발생 오류 내용 Cannot read properties of null (reading 'parentNode') TypeError: Cannot read properties of null (reading 'parentNode') at options.insert (webpack- 두번째 오류 Nextjs 에서 expose 할 때 Page 컴포넌트에 있는 useState를 사용 못한다고함 해결 : peerDependencies 로 nextjs 추가 → 오류동일 오류 내용 TypeError: Cannot read properties of null (reading 'useState') at useState (react.development.js:1623:21) at Page (index.js:8:40) react-dom.development.js:18704 The above error occurred in the <Page> component: 참고 : https://dev.to/omher/building-react-app-with-module-federation-and-nextjsreact-1pkh 두번째 오류를 해결해야 되는데 가능한 방법인지 모르겠습니다. 아시는 분은 댁글 남겨주세요~(코드상에 보안상 문제되는 부분은 a b 로 바꿨습니다.

개발자

#micro-frontend-architecture

#react

#next.js

#modulefederationplugin

답변 0

댓글 0

조회 298

일 년 전 · 익명 님의 질문

next js 프로젝트 mfa 구축 질문.

안녕하세요, next js프로젝트로 mfa를 구축중입니다. 모노레프 기반으로 구축중인데요, 타입스크립트를 적용하기 위해서 @module-federation/typescript 모듈설치후 next.config설정을 했는데, 아래와 같은 에러로그가 발생하면서 @mf-types폴더가 자동으로 생성되지않고있습니다.. 덕분에 리모트 파일은 타입에러를 뱉고 있는 상황이구요, 혹시 next js프로젝트로 mfa구축하신분들중 저와같은 사례가 있으신분 계신가요? 에러 내용 [1] <e> [FederatedTypesPlugin] Unable to download 'container' remote types index file: timeout of 3000ms exceeded [1] <e> [FederatedTypesPlugin] Unable to download types from remote 'container'

개발자

#react

#nextjs

#mfa

답변 0

댓글 0

조회 131

일 년 전 · 개발새발 님의 질문 업데이트

@nestjs/cli로 설치한 프로젝트는 yarn berry설정이되어있나요?

안녕하세요, 제목그대로 @nestjs/cli 로 설치한 프로젝트는 yarn berry 설정이 되어있는건가요? yarn로 선택하여, 보일러플레이트를 다운받아왔고 yarn install 해줬는데 사진처럼 구조가 되었습니다. ( 사진을 클릭하시면 .yarn 폴더도 생성되어있는걸 확인하실수 있습니다.) 그러면 yarn berry 설정이 되어있는걸까요? yarn set version berry 를 입력해주지않아도되는건가요? 1. yarn berry 설정이 되어있으니 yarn set version berry를 안해줘도 된다. 1-1. 그러면 pnp (제로인스톨)옵션이 적용되어있는건가요? 2. .yarnrc.yml파일이 없으니 적용이안되어있는거다. yarn set version berry를 해줘야한다. 2-1 .yarnrc.yml에 nodeLinker: pnp 를 적어서 pnp 옵션도 제대로 적용시켜줘야한다. 혹시 1번과 2번중 어떤게 맞는걸까요? 혹시 2번이라면 @nestjs/cli로 설치한 프로젝트는 yarn install해줘도 node_modules 폴더가 생성되지않고 .yarn 폴더안에unplugged 폴더가 설치되어있고 여기에@nestjs-core나 prettier 폴더들이 되어있는데.. 이거는 왜 그런건지 알고싶습니다

개발자

#yarn-berry

답변 0

댓글 0

조회 66

일 년 전 · 익명 님의 질문

Next.js 에서 fluent-ffmpeg 사용 시 에러 해결 가능할까요?

Next.js 에서 puppeteer를 사용해서 특정 url에 접속하여 애니메이션을 png로 100장 정도 캡처하여 생성하고, fluent-ffmpeg를 사용해서 해당 png 이미지들을 mp4 영상으로 만들려고 하는데요. yarn add puppeteer fluent-ffmpeg @ffmpeg-installer/ffmpeg yarn add --dev @types/fluent-ffmpeg 위와 같이 라이브러리들을 설치했구요. 아래 page.tsx 파일에서 코드를 구현했는데요. dev로 실행해서 해당 페이지에 접속을 하면 아래와 같은 에러가 발생하는데요. 해결이 가능할까요?? 다른 라이브러리를 써야할지 구현한 코드가 문제가 있는지 모르겠네요. 도움 부탁드립니다!! # 에러 코드 # 1 of 1 error Next.js (14.2.3) Server Error Error: Cannot find module '/Users/.../animation-capture/node_modules/@ffmpeg-installer/darwin-arm64/package.json' This error happened while generating the page. Any console logs will be displayed in the terminal window. Call Stack webpackEmptyContext file:///Users/.../animation-capture/.next/server/app/capture/page.js (22:10) eval node_modules/@ffmpeg-installer/ffmpeg/index.js (40:27) (rsc)/./node_modules/@ffmpeg-installer/ffmpeg/index.js file:///Users/.../animation-capture/.next/server/vendor-chunks/@ffmpeg-installer.js (20:1) Next.js eval /./src/app/capture/page.tsx (rsc)/./src/app/capture/page.tsx file:///Users/.../animation-capture/.next/server/app/capture/page.js (286:1) Next.js # 코드 구현부 # import { NextApiRequest, NextApiResponse } from 'next'; import puppeteer from 'puppeteer'; import fs from 'fs'; import path from 'path'; import ffmpeg from 'fluent-ffmpeg'; import ffmpegInstaller from '@ffmpeg-installer/ffmpeg'; ffmpeg.setFfmpegPath(ffmpegInstaller.path); .... 중략.... const outputFilePath = path.resolve("./screenshots/video.mp4"); ffmpeg() .addInput(`${folderPath}/screenshot-%d.png`) .inputFPS(10) .output(outputFilePath) .on("end", () => { res.status(200).send(`Video created successfully at ${outputFilePath}`); }) .on("error", (err) => { console.error("Error generating video:", err); res.status(500).send("Failed to generate video"); }) .run(); } catch (error) { console.error("Error capturing screenshots:", error); res.status(500).send("Failed to capture screenshots"); }

개발자

#next.js

#fluent-ffmpeg

#mp4

답변 0

댓글 0

조회 107

일 년 전 · 익명 님의 새로운 댓글

왜 이렇게 나올까요 ㅠㅠ 도와주세요 ㅠㅠ

Fatal Python error: init_import_site: Failed to import the site module Python runtime state: initialized Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap>", line 980, in exec_module File "<frozen site>", line 626, in <module> File "<frozen site>", line 612,

개발자

#python3

답변 1

댓글 1

보충이 필요해요 2

조회 223

일 년 전 · 소지우 님의 답변 업데이트

package.json 파일에 대해 질문있습니다.

프론트엔드 공부하고 있는 초보자입니다. 공부를 하다 몇가지 궁금한점이 있어 질문을 드립니다. 1. 처음에 html, css, js 파일로만 만들어 코드 작성을 하고 필요한 패키지들은 cnd 코드를 복붙해서 이렇게 사용을 했었는데 npm init -y 이 명령어를 작성하는 이유는 무엇인가요? 2. npm install 로 패키지를 설치하면 node_modules폴더가 생성되는데 이 폴더는 설치된 패키지 관련 폴더들이 들어있는건가요? 3. package.json에서 설치한 패키지를 사용할때 아래 이미지 처럼 코드를 수정해서 npm run 명령어를 이용해서 실행을 하던데 경로를 작성을 한건가요? 첫번째 이미지는 parcel ./index.html 을 작성했고 두번째는 sass인데 sass는 styles/main.scss 로 했는데 inex.html로 할지 main.scss로 할지 이건 어떻게 알 수있나요? 그리고 두번째 이미지에서 "node-sass": "node-sass" 이건 뭔지도 알고싶습니다. 초보자라 어려운 설명보다 정말정말 쉽게 설명해주시면 너무 감사드리겠습니다.

개발자

#프론트엔드

#package.json

#npm

#초보-공부

답변 2

댓글 1

조회 129

일 년 전 · 안희수 님의 새로운 답변

안드로이드 개발자 필요 역량

안녕하세요 안드로이드 개발에 대한 경험이 조금 있으며 간단한 개인 앱도 출시를 해봤습니다. 하지만 개인적으로 더 공부하지 않은 것도 있고 회사에서 앱은 많이 하지않았고 다른 개발만 얕게 몇 년째 했습니다. 총 경력은 5년이고 앱을 주로 하기 위하여 이직을 하고자 합니다. 3~5년 정도의 안드 개발자 공고를 보면 필요 요건들은 비슷했습니다. Retrofit, MVVM, AAC, Coroutine, compose, Clean Architecture, DI(Hilt/Koin), Multi Module 등이 나열되어 있었습니다. 이것들을 학습 및 실제 토이 프로젝트에 적용하는 것만으로는 3~5년 정도라고 할 수 없을거 같은데 어떠한걸 더 해보거나 능력을 갖추어야 할까요? 감사합니다

개발자

#안드로이드

#앱개발

#이직

답변 1

댓글 0

조회 175

일 년 전 · 허형준 님의 새로운 답변

리액트 네이티브 라이브러리가 안 돼요

gradient랑 fontawsome도 그렇고 대부분의 npm install 해야하는 라이브러리들이 안 돼요... install하고 import를 해줘도 안드로이드 에뮬레이터에서 Render Error requireNativeComponent: "(추가하려는것)" was not found in the UIManager라고 뜨네요 밑에 문제가 있는거 알려주는 source 부분에서는 node_modules\invariant\browser.js 여기를 가르키는데 또 그 파일 찾아가서 코드를 봐보면 어디가 잘못된건지 모르겠어요 혹시 몰라서 적자면 밑에 코드 부분이 잘못됐다고 나와요

개발자

#react-native

#리액트네이티브

#render_error

답변 1

댓글 0

조회 68

일 년 전 · 익명 님의 새로운 댓글

Nextjs App router 동작 방식이 이해가 안됩니다.

https://nextjs.org/docs/app/building-your-application/rendering/client-components // 문서내용 Defining multiple use client entry points: You can define multiple "use client" entry points in your React Component tree. This allows you to split your application into multiple client bundles (or branches). However, "use client" doesn't need to be defined in every component that needs to be rendered on the client. Once you define the boundary, all child components and modules imported into it are considered part of the client bundle. => 클라이언트 컴포넌트의 하위 컴포넌트들은 자동으로 전부 클라이언트 컴포넌트가 됨(use-client 명시할 필요X) 으로 이해했습니다. 그런데 첨부한 코드의 동작방식이 이해가 안됩니다. 예상 1. TestComponent가 클라이언트 컴포넌트(CSR)이므로 내부에 있는 HotEventList도 클라이언트 단에서동작할 것이다. 2. TestComponent를 ‘use client’로 클라이언트 컴포넌트로 만들었다. HotEventList에서는 useState등 CSR에 필요한 요소를 추가하더라도 ‘use client’를 추가할필요가 없다. TestComponent하위에 있어서 자동으로 클라이언트 컴포넌트가 되기 때문이다. 실제 1. HotEventList는 여전히 SSR로 동작한다. 2. HotEventList에 state를 추가하면 ‘use client’를 명시하라는 에러가 발생한다. 제가 어떤 부분을 잘못 이해하고 있는걸까요?

개발자

#next.js

#react

#ssr

#csr

#server-component

답변 1

댓글 1

조회 218

2년 전 · 익명 님의 새로운 답변

next.js 12version setting (npx create-next-app@12 my-next-app) 12버전이 설치되지 않는 이유

현재 회사에서 사용하는 next.js 12버전으로 기술 학습을 하려합니다. 그러나 아래와 같은 에러가 계속 발생하는데요, error next@14.0.4: The engine "node" is incompatible with this module. Expected version ">=18.17.0". Got "16.14.2" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. 12버전으로 설치하려는데 자꾸 14버전이 설치가 되면서 node version 에러가 뜨고 있습니다.. 저는 node 16.14.2를 사용중이며, 사측도 동일하게 해당 버전을 사용중입니다. 초기 세팅과정에서 next.js 12버전으로 세팅이 안된다고 판단하고, next.js 12로 다운그레이드 하려면 14버전으로 설치 후에, 다운그레이드를 시도해보았으나 "Detected next.config.js, no exported configuration found" 터미널에 해당 에러가 발생되었습니다. 제가 너무 답답한 부분을 요약하겠습니다. 1. next.js 12버전 초기 세팅이 안된다고 판단. 이후 next.js 최신 14버전 설치 ➡️ 실행하면 잘 작동함. 2. 최신 14버전에서 12버전으로 버전을 낮추고 실행하면 next.config.js에서 문제가 발생함 혹시 최근에 next.js 12버전으로 초기세팅 되신 분이 계실까요..😢

개발자

#next.js

#next.js-12

답변 1

댓글 0

조회 154

2년 전 · 고건 님의 새로운 댓글

nginx 관련 질문 있습니다 ㅠㅠ

안녕하세요, 현재 프로그래밍을 공부하고 있는 학생입니다. 공부를 하던 중 django를 사용해 프로젝트를 진행했고 aws, nginx, uwsgi 로 배포를 진행하게 되었는데, 배포는 성공적으로 됐지만 처리해야할 데이터가 많은 기능을 사용하면 자꾸 아래 오류가 뜨더군요. (퍼블릭 ip 주소는 X로 가렸습니다) 2023/11/07 15:14:13 [error] 7487#7487: *1 upstream timed out (110: Unknown error) while reading response header from upstream, client: xx.xxx.xxx.xxx, server: _, request: "POST /file_upload/upload/ HTTP/1.1", upstream: "uwsgi://unix:/home/ubuntu/docusift/uwsgi.sock", host: "xx.xxx.xxx.xx", referrer: "http://xx.xxx.xxx.xx/success_with_token/WeDkQYs84hDYcDsl/" 구글링을 해봐도, 스택오버플로우를 찾아봐도 110 오류가 unknown error로 뜨는 것에 대한 해결책은 나오지 않아서 이렇게 여쭤보게 되었습니다. 다만 구글링을 해본 결과 설정을 따로 만져줘야 한다는 것을 봐서 설정은 아래처럼 해놓은 상태인데, 아직 해결은 되지 않은 상황입니다. [uwsgi] chdir=/home/ubuntu/docusift/blog module=blog.wsgi:application master=True pidfile=/tmp/project-master.pid vacuum=True max-requests=5000 daemonize=/home/ubuntu/docusift/debug_uwsgi.log home=/home/ubuntu/docusift/venv virtualenv=/home/ubuntu/docusift/venv socket=/home/ubuntu/docusift/uwsgi.sock chmod-socket=666 socket-timeout=600 harakiri = 300 http-timeout = 300 server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.html index.htm index.nginx-debian.html; server_name _; location / { include /etc/nginx/uwsgi_params; uwsgi_pass django; proxy_buffer_size 512k; proxy_buffers 16 512k; proxy_busy_buffers_size 1024k; proxy_connect_timeout 500s; proxy_send_timeout 500s; proxy_read_timeout 500s; send_timeout 500s; } location /static/ { alias /home/ubuntu/docusift/blog/staticfiles/; } http { upstream django { server unix:/home/ubuntu/docusift/uwsgi.sock; } client_max_body_size 100M; proxy_connect_timeout 800s; proxy_send_timeout 800s; proxy_read_timeout 3600; 혹시라도 해결 방법을 아시는 분들 답변 주시면 정말 감사하겠습니다!!!

개발자

#배포

#aws

#ubuntu

#nginx

#uwsgi

답변 1

댓글 1

조회 181

2년 전 · 이상선 님의 새로운 답변

Lighthouse를 이용한 성능 최적화 - 텍스트 압축 사용

안녕하세요. 개발한 웹 페이지를 lighthouse를 통해 성능 최적화에서 난관을 겪고 1년차 React 개발자입니다. lighthouse에서 추천 항목에 "텍스트 압축 사용"을 적용해보려 시도 중입니다. .htaccess 파일에 다음과 같은 코드를 넣어서 텍스트 압축을 실행하였습니다. <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf </IfModule> 결과적으로 네트워크 탭에서 Content-Encoding: gzip 으로 표시되는 것을 보니까, 텍스트 압축이 되는 것처럼 보입니다. 그런데 lighthouse에서는 성능 점수가 더 올라가지 않고 있습니다. 혹시 "텍스트 압축" 부분에서 최적화 하는 다른 방법이 있을까요? 아니면 제가 놓치고 있는 부분이 있는 걸까요?

개발자

#react

#lighthouse

#front-end

답변 1

댓글 0

조회 335

2년 전 · nowv 님의 새로운 댓글

mysql 인스턴스에서 여러 스키마를 생성하는 것이 불필요한 건가요?

과거 mysql을 사용할 때 하나의 스키마 아래에 여러 테이블을 만들어 작업한 적이 있습니다. 스키마 아래로 너무 많은 테이블들이 생성되어 테이블간 연관성이나 관계를 확인하기가 쉽지 않았습니다. 이번 프로젝트에서는 과거처럼 하나의 스키마(my_db)가 아니라 연관성이 높은 테이블들을 스키마별로 모아서 연결하고 싶었습니다. 예를 들자면, user관련 테이블들은 Users스키마에, product과 연관된 테이블들은 Products스키마에, 중간테이블이 필요하면 Users_Products스키마에 테이블을 저장했습니다. 이 구조라면 하나의 mysql 인스턴스에 3개의 스키마가 생성된 것입니다. 문제는 nestjs에서 typeorm 설정을 하는 과정에서 database를 입력하는 부분에서 발생했습니다. TypeOrmModule.forRoot에서 database이름을 하나밖에 입력할 수 없었습니다.(mysql은 database와 schema를 동의어로 취급한다고 들었습니다.) 3개의 스키마를 연결하는 방법은 다음과 같다는 것을 발견했습니다. 이런 방법을 쓰는 이유를 작성자는 서비스용 database, 정보분석용 database를 나눠서 사용하기 위함이라고 말합니다. https://www.inflearn.com/questions/662388/typeorm-%EB%8B%A4%EC%A4%91-%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%B0%EA%B2%B0 mysql로 하나의 서비스를 위해 스키마를 여러개로 나누어서 하나의 앱에 적용하는 것이 불필요한 방법일까요?

개발자

#mysql

#nestjs

#typeorm

#schema

답변 1

댓글 1

조회 318

2년 전 · 손호영 님의 질문

크롬에서 API 구축문제

VM283:5 crbug/1173575, non-JS module files deprecated.라는 에러가 떴다. 이에 모든 것을 해결했는데 되지 않았았다 어떻게 해야할까요?

개발자

#api

답변 0

댓글 0

보충이 필요해요 1

조회 83

2년 전 · 김태우 님의 새로운 댓글

[Next.js] 미디어쿼리가 모바일 배포환경에서만 적용되지 않습니다ㅠㅠ

현재 Next.js를 이용해서 프로젝트를 진행하고 있는 대학생입니다! 프론트엔드를 개발하면서 반응형 웹을 계획하고 미디어쿼리를 이용해 반응형 레이아웃을 테스트하는데 데스크탑 개발환경 및 배포(vercel)환경에서는 미디어쿼리가 잘 작동하지만 모바일로 배포환경에 접속하면 미디어쿼리가 적용되지 않습니다. 해결을 위해 시도한 방법 1. "일반 css파일과 css_module파일이 특정 상황에서 충동을 일으킬 수 있다"는 정보를 토대로 모든 스타일 파일을 css_module로 통일했습니다. 2. "metadata에 viewport 구문이 빠져있을 수 있다"는 정보를 토대로 next/Head를 이용해서 viewport를 따로 명시했습니다. 위 방법들을 모두 시도했지만 여전히 데스트톱에서만 미디어쿼리가 작동하고 모바일 배포환경에서는 먹통입니다. 선배님들의 도움이 필요합니다ㅜㅜ

개발자

#react

#next.js

#vercel

#media-query

답변 2

댓글 2

보충이 필요해요 1

조회 1,930

2년 전 · 손호영 님의 질문 업데이트

닫힌 질문 | 문제가 뭔지 알려주세요

<!DOCTYPE html>> <html> <head> <title>Love 출석부 로그인</title> <style> h1{ position: absolute; left: 650px; } </style> <script>let name =document.getElementById("samename") alert(name.values+"님 환영합니다.") event.preventDefault();</script> </head> <body> <h1>로그인</h1> <form accept="API.py" method="post" onsubmit="keypress" method="get" action="Love2.html"> 이름:<input type="text" id="samename" size="30" value=""><br> </form> </body></html> 이름을 쓰고 엔터를 누르면 그 다음에 출석부 사이트에 가는데 문제는 엔터를 누르면 crbug/1173575, non-JS module files deprecated.라고 떠요

개발자

#javascript

#백앤드

#html

#css

답변 0

댓글 0

보충이 필요해요 5

조회 102

2년 전 · 익명 님의 질문 업데이트

SCSS 사용법이 궁금합니다.(scss vs module.scss)

안녕하세요 웹 프론트엔드 주니어 개발자입니다. SCSS를 사용할 때, 저는 기본 scss파일을 사용하고 컴포넌트 최상위의 클래스 안에서 style을 작성하고 있습니다. (ex:scss파일에서 .최상위클래스{하위 클래스 style작성} ) 그런데 이 방식이 맞는지, 아니면 module.scss로 해당 파일에서만 작동되게 하는 게 맞는지 궁금해서 질문드립니다. 보통은 SCSS를 어떻게 사용하시나요??ㅠ

개발자

#scss

#module.scss

#프론트엔드

답변 0

댓글 0

조회 82

2년 전 · 털먹는토끼 님의 새로운 댓글

next.js 특정 페이지에 컴포넌트 미출력 기능 구현 이슈(use client 사용)

로그인페이지(/user-page)에서 footer컴포넌트를 안띄우는 기능을 구현하고 싶어 footer 컴포넌트를 csr 방식으로 사용하도록 'use client' 줬습니다. 근데 error ReferenceError: window is not defined 라는 에러가 뜨면서 적용이 안되네요ㅠㅠ nextjs는 ssr이니까 window에 접근하기 위해선 'use client'를 주면 된다고 들었는데 왜 안되는걸까요?? 찾아보니까 useEffect 쓰라해서 useEffect도 써봤는데 에러가 뜨진않지만 여전히 적용안되더라구요. 문제점 알려주시면 감사하겠습니다ㅠㅠㅠ <footer.tsx 파일> 'use client' import React, { useEffect } from 'react' import style from '../styles/footer.module.scss' const Footer = () => {     if (window.location.pathname === '/user-page') return null return ( -생략- ) } <루트 layout.tsx 파일> 'use client' export default function RootLayout({     children, }: {     children: React.ReactNode }) {   return (         <html lang="ko">             <body className={inter.className}>                 <div className="wrap bg-white">                     <Header />                     {children}                     <Footer />               </div>             </body>         </html>     ) }

개발자

#next.js

답변 3

댓글 3

조회 383

2년 전 · 오승우 님의 새로운 댓글

리액트 컴포넌트 라이브러리 구현 시 에러

React 스타일 컴포넌트 라이브러리를 제작중입니다. Ts / rollup / yarn berry를 사용했으며 @emotion/styled를 사용해서 기본적인 스타일링을해서 사용했을 땐 별 문제 없이 의존성 설치도 되고 사용에 이상이 없었으나 React key값 관리와 차트 사용을 위해 차트 "apexcharts": "^3.42.0", "react-apexcharts": "^1.4.1", key 값 "shortid"를 사용하니까 의존성을 받아 사용하던 프로젝트에서 에러가 발생했습니다 "Uncaught SyntaxError: The requested module '/node_modules/react-apexcharts/dist/react-apexcharts.min.js?v=73045f40' does not provide an export named 'default' " 직접 제작한 라이브러리에서 외부 라이브러리를 사용하려면 혹시 다른 방법이 필요한걸까요..??

개발자

#react

#module

#library

#component

답변 1

댓글 1

조회 147

2년 전 · 익명 님의 질문 업데이트

ESLINT 어떤 것을 수정해야 내용처럼 fix 되는 현상을 막을 수 있을까요?

안녕하세요~ eslint, prettier에서 제가 무엇을 잘못했는지 계속 아래처럼 코드가 수정되고 있습니다. const res = (await request) < User > (context, `/users/${id}`); 어떻게 하면 고칠 수 있을까요? 1. (await request) 소괄호 제거 2. < User > 제너릭 사이 공백 제거 결론: const res = await request<User>(context, `/users/${id}`) 로 만들고 싶습니다.. 아래는 eslint 적용한 내용 입니다. ``` //eslint.config.js module.exports = { env: { browser: true, es2021: true, }, extends: [ 'plugin:react/recommended', 'airbnb', 'plugin:storybook/recommended', ], parser: '@typescript-eslint/parser', parserOptions: { project: ['./tsconfig.json'], ecmaVersion: 2018, sourceType: 'module', createDefaultProgram: true, }, plugins: ['react', '@typescript-eslint', 'prettier', 'import'], rules: { 'react/react-in-jsx-scope': 'off', 'react/jsx-props-no-spreading': 'off', 'import/prefer-default-export': 'off', 'implicit-arrow-linebreak': 'off', 'react/jsx-filename-extension': [ 2, { extensions: ['.js', '.jsx', '.ts', '.tsx'], }, ], 'object-curly-newline': [ 'error', { ObjectPattern: { multiline: true, minProperties: 2, }, ImportDeclaration: 'never', ExportDeclaration: { multiline: true, minProperties: 3, }, }, ], 'import/extensions': [ 'error', 'ignorePackages', { js: 'never', mjs: 'never', jsx: 'never', ts: 'never', tsx: 'never', }, ], 'import/order': [ 'error', { alphabetize: { order: 'asc', }, groups: [ 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type', ], }, ], 'import/no-unresolved': 'off', }, settings: { 'import/resolver': { typescript: { alwaysTryTypes: true, }, node: { paths: ['src'], }, }, }, }; ```

개발자

#eslint

#prettier

답변 0

댓글 0

조회 85

2년 전 · 조용구 님의 새로운 답변

여러분의 회사에서는 어떤 CSS 라이브러리를 사용하시나요?

Q. 회사에서 어떤 CSS 라이브러리를 사용하고 계시며, 장점과 단점을 알려주실 수 있나요? Q. 반응형 웹사이트와 유지보수의 관점에서, 어느 css 라이브러리를 선택하는 것이 좋을까요? 회사에서 웹사이트를 개발 중인 신입 프론트엔드 개발자입니다. 기존에 Vue로 작성된 레거시 코드를 React로 마이그레이션하고 있습니다. 기존 코드의 스타일링은 css 파일을 import하는 방식으로 사용되었습니다. 이를 React로 변경했을 때, 클래스명이 중복되는 문제가 있어서, css-module을 사용하는 중입니다. (참고로 디자인은 정해져있는 상태입니다.) 앞으로 웹사이트를 반응형으로 제작해야하고, 기능을 추가해야합니다. 또 추후에 다른 사람이 코드를 보고 디자인을 수정해야하는 상황이 올 때, 쉽게 변경할 수 있게 만들고 싶습니다. 제가 익숙한 css 라이브러리는 Tailwind인데, 이 라이브러리는 클래스명이 복잡성이 있고, className이 길어질 수 있다는 단점 때문에, 일부 개발자들이 기피한다고 들었습니다. 제가 선택할 라이브러리를 앞으로도 회사에서 계속 사용하게 될 것 같은데, 어떤 것이 프로젝트 진행에 도움이 될 지, 혹시나 선택한 라이브러리가 걸림돌이 되진 않을지 불안합니다. 여기 계신 개발자분들은 어떤 css 라이브러리를 사용하고 계시며, 어떤 장점이 있나요?

개발자

#프론트엔드

#css

#tailwind

#bootstrap

#react

답변 5

댓글 0

추천해요 3

조회 2,637

2년 전 · 커리어리 AI 봇 님의 새로운 답변

MIME JS - ES MODULE간 상태값 체크방법이 궁금합니다.

바닐라 JS를 사용하고있습니다. 목적은 MIME JS에 비동기 함수이 완료되면, ES MODULE에 있는 특정 함수가 실행되게 하려고합니다. MIME JS에 있는 비동기 함수에서 반환되는 프로미스 값으로 일종의 상태값을 반환되게해서, 해당 상태값을 global 객체로 올려 모듈에서 폴링방식으로 상태값을 체크하여, 함수를 실행하게하고있는데, 더 좋은 방법이 있는지 궁금하여 질문드립니다!

개발자

#javascript

답변 1

댓글 0

조회 71

2년 전 · 커리어리 AI 봇 님의 새로운 답변

Next.js v13 React Essentials부분 질문입니다.

[카테고리]App Router->React Essentials https://nextjs.org/docs/getting-started/react-essentials 1번문장 Client Components에서 "Once "use client" is defined in a file, all other modules imported into it, including child components, are considered part of the client bundle."라는 문장과 2번문장 Composing Client and Server Components에서 "On the server, React renders all Server Components before sending the result to the client. This includes." 1번문장과 2번문장이 모순된것처럼 느껴집니다. 1번문장을 "use client"를 명시한 file에 import된 하위 자식컴포넌트 역시 Client Components로 간주된다고 이해했는데, 그럼 2번문장과 같이 클라이언트 컴포넌트하위에 있는 "Server Components nested inside Client Components" 역시 클라이언트 컴포넌트로 간주되어서 클라이언트 컴포넌트의 렌더링방식을 따라야하는 것 아닌가요??

개발자

#next.js

#server-component

#client-component

답변 2

댓글 3

조회 589

일 년 전 · 익명 님의 질문 업데이트

JS에서 기능 구현 시 function 또는 class를 어떻게 적절하게 선택해서 사용하시나요?

안녕하세요. TypeScript와 같은 언어가 아닌 바닐라JS, Node.js에서 코드를 작성하면서 막연한 궁금증이 하나 생겼습니다. 일반적으로 단일 기능이라면 함수로 기능 하나를 구현하고 이러한 기능이 하나일 경우엔 "export default"를 2개에서 4개 정도는 "module.exports"를 이용하고 있습니다. 또는 하나의 주제로 다양한 기능이 있을 경우엔 클래스로 구현하고 클래스 내 멤버들 간 "this"를 이용한 멤버 호출 등이 있기도 합니다. 다른 분들은 어떤 기준으로 기능을 함수로 만들지 클래스로 만들지 결정하시나요? 이를테면 상속이라던지 그 외 클래스 특징이 필요할 때 클래스로 구현하고 그 외에는 함수로 구현하시나요? 생각처럼 깔끔하게 머릿속에서 정리가 안되서 질문드립니다 :)

개발자

#javascript

#nodejs

#function

#class

답변 2

댓글 2

조회 390

2년 전 · 커리어리 AI 봇 님의 새로운 답변

Node.js setHeader

너무 당연하게 express 프레임워크를 사용하다가 좋은 강의를 우연히 접하고 다시 처음부터 Node.js 기초를 공부하고 있는데요 express에서는 등록된 route handler들을 보고 개발자가 수동으로 header의 Content-Type을 안 정해줘도 된다면 express가 아닌 Node.js의 built-in module만 가지고 request response를 작성하면 setHeader로 Content-Type을 일일이 명시하지 안했을시 response에 담기는 Contents에 따라 (json 이나 html) 그냥 text로 출력되거나 출력이 제대로 안될까? 생각했었는데 express를 사용했을때와 차이없이 정상적으로 출력이 돼서 setHeader로 Content-Type을 명시하는 이유가 뭘까 궁금해서 질문을 남깁니다. //setHeader부분 주석처리하면 제대로 출력안될것으로 예상했으나 잘 동작해서 궁금증이..

개발자

#node.js

답변 2

댓글 0

조회 113