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

fix: dynamic import of vite #24745

Merged
merged 2 commits into from
May 14, 2024
Merged

fix: dynamic import of vite #24745

merged 2 commits into from
May 14, 2024

Conversation

alper98
Copy link
Contributor

@alper98 alper98 commented May 13, 2024

Hey, I just made a Pull Request!

Fixes #24678

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@alper98 alper98 requested review from a team as code owners May 13, 2024 12:37
@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

@backstage-goalie
Copy link
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/cli packages/cli patch v0.26.5-next.1

Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

'@backstage/cli': patch
---

Fixed the dynamic import of vite.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if there's any particular version of vite where the behavior changes? Thinking it would be good if we could highlight that in the changeset. What version are you testing with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing with these versions

"@vitejs/plugin-react": "^4.0.4",
"vite": "^4.4.9",
"vite-plugin-html": "^3.2.0",
"vite-plugin-node-polyfills": "^0.21.0"

Copy link
Contributor Author

@alper98 alper98 May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which seems to match the backstage cli vite versions:

"@vitejs/plugin-react": "^4.0.4",
"vite": "^4.4.9",
"vite-plugin-html": "^3.2.0",
"vite-plugin-node-polyfills": "^0.21.0"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which version is it actually resolved to though in yarn.lock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our own backstage instance:

└─ app@workspace:packages/app
   └─ vite@npm:4.5.3 [f87a9] (via npm:^4.4.9 [f87a9])

while in my fork on this branch:

├─ @backstage/cli@workspace:packages/cli [05476]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [07278]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [11fe3]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [31634]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [39bca]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [70735]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [aad9f]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [b9c15]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ @backstage/cli@workspace:packages/cli [c856b]
  └─ vite@npm:4.5.3 [23bd4] (via npm:^4.4.9 [23bd4])

├─ example-app-next@workspace:packages/app-next
  └─ vite@npm:4.5.3 [d47fc] (via npm:^4.4.9 [d47fc])

└─ example-app@workspace:packages/app
   └─ vite@npm:4.5.3 [d47fc] (via npm:^4.4.9 [d47fc])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should actually bite the bullet and bump to vite@v5? Version 6 is on it's way soon, and from what I can tell I don't think that there's any breaking changes that we would run into.

@benjdlambert
Copy link
Member

I tried a bump to vite@5 but ran into this: rollup/rollup#5199 which the fixes are not really fixes. Not sure we can do moduleResolution: "bundler" either.

Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's :shipit: 👍

@Rugvip Rugvip merged commit e58a578 into backstage:master May 14, 2024
30 checks passed
Copy link
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.27.0 release, scheduled for Tue, 14 May 2024.

Copy link
Contributor

Uffizzi Cluster pr-24745 was deleted.

@alper98 alper98 deleted the fix/vite-import branch May 14, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: TypeError: Cannot read properties of undefined (reading 'createServer')
4 participants