Skip to content

rhwp-firefox: vite.config.ts에 __APP_VERSION__ define 누락 — 제품 정보 다이얼로그 ReferenceError #205

@edwardkim

Description

@edwardkim

현상

Firefox 확장(rhwp-firefox)을 임시 부가 기능으로 로드한 뒤 메뉴 → 도움말 → 제품 정보 클릭 시 콘솔 에러.

```
[CommandDispatcher] 커맨드 실행 실패: file:about ReferenceError: APP_VERSION is not defined
createBody moz-extension://.../assets/viewer-C0NXlh5b.js:10
build .../viewer-C0NXlh5b.js:10
show .../viewer-C0NXlh5b.js:10
execute .../viewer-C0NXlh5b.js:44
```

원인

`rhwp-firefox/vite.config.ts` 에 `define: { APP_VERSION: ... }` 주입이 빠져 있음. about-dialog 에서 `APP_VERSION` 전역을 참조하지만 Vite 가 치환해주지 않아 런타임 ReferenceError.

rhwp-studio / rhwp-chrome 의 vite.config.ts 에는 정상적으로 주입되어 있음:

```ts
const studioPkg = JSON.parse(
readFileSync(resolve(__dirname, '..', 'rhwp-studio', 'package.json'), 'utf-8'),
);

export default defineConfig({
...,
define: {
APP_VERSION: JSON.stringify(studioPkg.version),
},
...
});
```

배경

수정 방안

`rhwp-firefox/vite.config.ts` 에 rhwp-chrome 과 동일한 패턴으로 `readFileSync` import + `studioPkg` 로딩 + `define: { APP_VERSION: JSON.stringify(studioPkg.version) }` 추가.

테스트

  • 재빌드 (`cd rhwp-firefox && npm run build`)
  • Firefox about:debugging 에서 확장 재로드
  • 메뉴 → 도움말 → 제품 정보 → 콘솔 에러 없음 + 버전 표시 정상

관련

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions