talkjs / country-flag-emoji-polyfill

Add country flag emojis to Chromium-based browsers on Windows
Other
140 stars 9 forks source link

Failed to parse source map #5

Closed guidupuy closed 1 year ago

guidupuy commented 1 year ago

Getting this when compiling a CRA project after adding this package:

WARNING in ./node_modules/is-emoji-supported/dist/esm/is-emoji-supported.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/***/Documents/***/node_modules/is-emoji-supported/src/is-emoji-supported.ts' file: Error: ENOENT: no such file or directory, open '/Users/***/Documents/***/node_modules/is-emoji-supported/src/is-emoji-supported.ts'
 @ ./node_modules/country-flag-emoji-polyfill/dist/index.modern.js 1:0-59 7:6-7 7:18-19
 @ ./src/App.tsx 53:0-72 79:4-29
 @ ./src/index.tsx 7:0-24 39:19-22
eteeselink commented 1 year ago

To be frank, I have no idea. This looks like either a build tool problem or a problem with is-emoji-supported. It makes no sense to me for a source map loader to try to parse typescript files but I'm no build guru so maybe it actually does make sense somehow. Also I've never used CRA - if somehow this is a CRA-specific quirk, feel free to contribute a fix either here or to CRA!

If you remove country-flag-emoji-polyfill and add is-emoji-supported and call it on startup (like here https://github.com/koala-interactive/is-emoji-supported#basic-usage), do you get the same error? If yes, then it's for sure got nothing to do with country-flag-emoji-polyfill.