Hashnode / Hashnode/starter-kit
iFrame Script Source URL
Abierto
- Lenguaje dominante
- TypeScript
- Estrellas
- 648
- Forks
- 921
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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`;
```
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.