Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andrearonsen opened this issue Jan 4, 2024 · 4 comments · Fixed by #2695
Closed

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

andrearonsen opened this issue Jan 4, 2024 · 4 comments · Fixed by #2695
Assignees
Labels
Type: TypeScript Issues related to typescript or type definitions

Comments

@andrearonsen
Copy link

andrearonsen commented Jan 4, 2024

Describe the bug
When building a project with Vite 5 and Rollup, the following non-blocking warnings are outputted:

vite v5.0.10 building for production...
node_modules/victory-core/es/victory-primitives/rect.js (16:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/rect.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/victory-core/es/victory-primitives/rect.js (21:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/rect.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/victory-core/es/victory-primitives/clip-path.js (5:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/clip-path.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/victory-core/es/victory-primitives/circle.js (16:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/circle.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/victory-core/es/victory-primitives/circle.js (21:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/circle.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/victory-core/es/victory-primitives/line.js (16:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/line.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/victory-core/es/victory-primitives/line.js (21:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/line.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/victory-core/es/victory-primitives/path.js (17:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/path.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/victory-core/es/victory-primitives/path.js (22:2) A comment

"/*#__PURE__*/"

in "node_modules/victory-core/es/victory-primitives/path.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.

Victory version
36.7.0

To Reproduce
Steps to reproduce the behavior:

  1. yarn create vite
    ✔ Project name: … test-victory-warns
    ✔ Select a framework: › React
    ✔ Select a variant: › TypeScript + SWC
  2. cd test-victory-warns
  3. yarn
  4. yarn add victory
  5. Edit App.tsx: import { VictoryBar } from "victory”; and <VictoryBar />
  6. yarn build
  7. See the warnings

Expected behavior
No warnings.

@carbonrobot
Copy link
Contributor

Could you share a reproduceable example or at least the rollup/vite configs?

@andrearonsen
Copy link
Author

Example:

1. yarn create vite
✔ Project name: … test-victory-warns
✔ Select a framework: › React
✔ Select a variant: › TypeScript + SWC
2. cd test-victory-warns
3. yarn
4. yarn add victory
5. Edit App.tsx: import { VictoryBar } from "victory”; and <VictoryBar />
6. yarn build
7. See the warnings

@carbonrobot
Copy link
Contributor

carbonrobot commented Jan 5, 2024

@carbonrobot carbonrobot self-assigned this Jan 5, 2024
@carbonrobot carbonrobot added the Type: TypeScript Issues related to typescript or type definitions label Jan 5, 2024
@carbonrobot
Copy link
Contributor

I have a working solution for this, will get it published soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: TypeScript Issues related to typescript or type definitions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants