a11y-react-emoji icon indicating copy to clipboard operation
a11y-react-emoji copied to clipboard

add inlineSources ts option

Open HarmonicTons opened this issue 3 years ago • 3 comments

Hi!

The generated source map is referencing the Emoji.tsx file, which is not present in the published version of the package. This triggers an error when building a package depending on a11y-react-emoji:

./myPackage/node_modules/a11y-react-emoji/src/Emoji.js
Failed to parse source map from 'myPackage/node_modules/a11y-react-emoji/src/Emoji.tsx' file: Error: ENOENT: no such file or directory, open 'myPackage/node_modules/a11y-react-emoji/src/Emoji.tsx'
 @ myPackage/node_modules/a11y-react-emoji/src/index.js 6:9-27 7:14-32

This can be fixed by adding the inlineSources option to tsconfig.json.

Link to the added option documentation: https://www.typescriptlang.org/tsconfig/#inlineSources

It's basicaly adding this line at the end of the Emoji.js file:

//# sourceMappingURL=Emoji.js.map

HarmonicTons avatar Jul 08 '22 15:07 HarmonicTons

Hey @HarmonicTons! Thanks for contributing 😄

This sounds reasonable to me. I'll take another look locally, and if everything checks out then I will merge and prepare a new release soon.

SeanMcP avatar Jul 13 '22 16:07 SeanMcP

🤔 It looks like that comment is already present in Emoji.js of the published package:

image

SeanMcP avatar Jul 13 '22 16:07 SeanMcP

I am able to build a new React project with Vite that uses a11y-react-emoji without any errors. @HarmonicTons could you maybe open an issue with the steps to reproduce the error?

SeanMcP avatar Jul 13 '22 16:07 SeanMcP

@HarmonicTons I'm going to close this PR for now. I'm happy to look at things again if we can get the issue reproducing reliably.

SeanMcP avatar Sep 19 '22 14:09 SeanMcP