Hashnode / Hashnode/starter-kit

iFrame Script Source URL

Đang mở
#163 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
648
Fork
921
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Disclaimer: I am not sure how important this issue is 😅
# Problem
Currently, in the [`packages/utils/renderer/services/embed.ts` ](https://github.com/Hashnode/starter-kit/blob/e8ef16f2343868d11e4bf9e5d57e717527f314f2/packages/utils/renderer/services/embed.ts#L202) the script src is constant that is, `/js/iframe-resizer.js` which do not work if `NEXT_PUBLIC_BASE_URL` is defined.

# Potential Solution
Make the `script.src` dynamic with `NEXT_PUBLIC_BASE_URL`

```js
const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL || '';

script.src = BASE_URL == '' ? `/js/iframe-resizer.js` : `${BASE_URL}/js/iframe-resizer.js`;
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.