Transpile to ES modules with Babel

While I was working on Navigo an issue popped out. It was about using the library in the context of Web Dev Server where we have everything in TypeScript. And something was not ok with Navigo. The npm package wasn’t exported properly and we were keep getting a does not provide an export named 'default' error. It turned out the problem is that Navigo is not exported properly as ES module (also known as ESM).


This content originally appeared on Krasimir Tsonev - blog and was authored by Krasimir Tsonev - blog

While I was working on Navigo an issue popped out. It was about using the library in the context of Web Dev Server where we have everything in TypeScript. And something was not ok with Navigo. The npm package wasn't exported properly and we were keep getting a does not provide an export named 'default' error. It turned out the problem is that Navigo is not exported properly as ES module (also known as ESM).


This content originally appeared on Krasimir Tsonev - blog and was authored by Krasimir Tsonev - blog


Print Share Comment Cite Upload Translate
APA
Krasimir Tsonev - blog | Sciencx (2023-02-04T21:28:18+00:00) » Transpile to ES modules with Babel. Retrieved from https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/.
MLA
" » Transpile to ES modules with Babel." Krasimir Tsonev - blog | Sciencx - Sunday February 7, 2021, https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/
HARVARD
Krasimir Tsonev - blog | Sciencx Sunday February 7, 2021 » Transpile to ES modules with Babel., viewed 2023-02-04T21:28:18+00:00,<https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/>
VANCOUVER
Krasimir Tsonev - blog | Sciencx - » Transpile to ES modules with Babel. [Internet]. [Accessed 2023-02-04T21:28:18+00:00]. Available from: https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/
CHICAGO
" » Transpile to ES modules with Babel." Krasimir Tsonev - blog | Sciencx - Accessed 2023-02-04T21:28:18+00:00. https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/
IEEE
" » Transpile to ES modules with Babel." Krasimir Tsonev - blog | Sciencx [Online]. Available: https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/. [Accessed: 2023-02-04T21:28:18+00:00]
rf:citation
» Transpile to ES modules with Babel | Krasimir Tsonev - blog | Sciencx | https://www.scien.cx/2021/02/07/transpile-to-es-modules-with-babel/ | 2023-02-04T21:28:18+00:00
https://github.com/addpipe/simple-recorderjs-demo