react-helmet-async icon indicating copy to clipboard operation
react-helmet-async copied to clipboard

`/*#__PURE__*/` annotations don't play well with Vite / Rollup

Open shellscape opened this issue 1 year ago • 3 comments

It looks like the build script for this lib is outputting code which contains /*#__PURE__*/ annotation comments. Unfortunately they look like they're misplaced, and we're getting some non-blocking warnings about it. Here's what the warnings look like when compiling an app which uses this lib, with Vite:

"/*#__PURE__*/"

in "../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-helmet-async/lib/index.module.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-helmet-async/lib/index.module.js (1:13561) A comment

"/*#__PURE__*/"

in "../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-helmet-async/lib/index.module.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.

shellscape avatar Dec 01 '23 14:12 shellscape

It's time to look for alternative libs. Any suggestions? :)

goliney avatar Feb 28 '24 04:02 goliney

The warning disappears from version 2.0.0. Because the lib switched to use esbuild. You can give it a try.

Here's the diff: https://github.com/staylor/react-helmet-async/compare/b1ee65880e71df9124c4e01d07c086d8ce2fc63a...a75c3ae812af1608a5f4c65b8c93c29e6896018b

thienandangthanh avatar Feb 28 '24 18:02 thienandangthanh

@thienandangthanh thank you for the response. If true, this issue should be closed.

goliney avatar Feb 28 '24 20:02 goliney