Skip to content

fix: analysing build chunk without dependencies#15469

Merged
patak-cat merged 4 commits intovitejs:mainfrom
morethanwords:main
Mar 4, 2024
Merged

fix: analysing build chunk without dependencies#15469
patak-cat merged 4 commits intovitejs:mainfrom
morethanwords:main

Conversation

@morethanwords
Copy link
Copy Markdown
Contributor

Description

Vite doesn't work well with chunks without dependencies. It crashes on build analysis stage. See this issue.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-cat patak-cat changed the title Fix analysing build chunk without dependencies fix: analysing build chunk without dependencies Jan 9, 2024
patak-cat
patak-cat previously approved these changes Jan 9, 2024
@patak-cat patak-cat added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jan 15, 2024
Comment thread packages/vite/src/node/plugins/importAnalysisBuild.ts Outdated
@SimonsUnikaNamn
Copy link
Copy Markdown

SimonsUnikaNamn commented Feb 12, 2024

Hello, I am having issues with migrating our large frontend repo from CRA to Vite because of this specific error

It is really hard to understand how I can avoid this without changing the vite package manually in node_modules. Maybe there is some sort of setting that could help me avoid it, or avoid using some sort of dynamic import? But I am not familiar enough to understand why this is happening.

@patak-dev could you bump the severity of this bug?

@CyberAP
Copy link
Copy Markdown
Contributor

CyberAP commented Mar 4, 2024

@patak-dev hi! Could I ask you to prioritise this if possible? The issue currently blocks updating Gitlab to Vite 5.1.4 because it breaks build stage.

BTW @morethanwords thank you for this fix!

@patak-cat
Copy link
Copy Markdown
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link
Copy Markdown

@patak-cat patak-cat merged commit bd52283 into vitejs:main Mar 4, 2024
@patak-cat
Copy link
Copy Markdown
Member

@SimonsUnikaNamn @CyberAP this should be fixed in vite@5.1.5. Let us know if you still see a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants