chrome-extension-boilerplate-react-vite icon indicating copy to clipboard operation
chrome-extension-boilerplate-react-vite copied to clipboard

Background 에서 module을 불러오지 못하는 문제

Open findmytrueself opened this issue 1 year ago • 4 comments

안녕하세요. 현재 Vue 프로젝트 파일을 React로 리팩터링 하는 중 입니다..

기존에 Vue 프로젝트에서 Background에서 사용 되던 코드를 재사용 하려고 붙여 넣었습니다.

vite로 bundling은 정상적으로 하는 것 같은데 Chrome Extension에서 자꾸 읽질 못하는 것 같습니다.

번들링된 패키지모듈을 크롬익스텐션에서 import할 방법이 있을까요?

findmytrueself avatar Sep 05 '22 08:09 findmytrueself

Thank you for your contribution. We will check and reply to you as soon as possible.

github-actions[bot] avatar Sep 05 '22 08:09 github-actions[bot]

have more informations?

JunyWuuuu91 avatar Sep 06 '22 01:09 JunyWuuuu91

I don't know if that's what you asking for but if you want to import things into background/index.js try adding this to manifest.ts:

background: { service_worker: "src/pages/background/index.js", type: "module" },

SafeAndS0und avatar Sep 06 '22 11:09 SafeAndS0und

any progress?

octofox1357 avatar Sep 14 '22 00:09 octofox1357

번들링된 패키지모듈 이라는 부분이 잘 이해가 되지 않아 상황에 대한 추가적인 정보를 요청드려도 될까요?

단순히 코드를 복사해서 붙여넣기했다면 동작하지 않을 이유가 없는데, 외부 의존성을 가져오는 부분에서 문제가 생겼다는 말씀이실까요?

Jonghakseo avatar Sep 16 '22 11:09 Jonghakseo

background에 import한 파일 안에 다른 import 구문을 사용한 경우 t is not defined 와 같은 에러가 발생합니다. 아마 이건 크롬 익스텐션 규칙 자체의 문제 아닐까요?

octofox1357 avatar Sep 19 '22 02:09 octofox1357

Close the issue for no further information.

Jonghakseo avatar Oct 25 '22 10:10 Jonghakseo