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

[WARN] [vite] build.terserOptions -- annoying false warning duiring project build #9341

Closed
1 task
genesem opened this issue Dec 6, 2023 · 2 comments · Fixed by vitejs/vite#15275
Closed
1 task
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@genesem
Copy link

genesem commented Dec 6, 2023

Astro Info

Astro                    v4.0.2
Node                     v20.10.0
System                   Windows (x64)
Package Manager          npm -- yarn@1.2 actually.
Output                   static
Adapter                  none
Integrations             @astrojs/vue
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

chrome, etc.

Describe the Bug

Astro build displays incorrect warning:

16:13:21 [**WARN] [vite] build.terserOptions is specified but build.minify is not set to use Terser. Note Vite now defaults to use esbuild for minification. If you still prefer Terser, set build.minify to "terser".**

astro config values are correct and were working fine with prev. version.
they are

...
vite: {
...
build: {
...
minify: "terser",
terserOptions: {
format: {
comments: false,
// safari10: true,
},
// mangle: {
// safari10 : true,
// module: true,
// },
ecma: '2015',
safari10 : true,
},

What's the expected result?

No warning should be displayed as option were set correctly.
minify: "terser", ...

Run 'yarn build' to check it out at repro. provided.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-5sum9v?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 6, 2023
@natemoo-re
Copy link
Member

I'm guessing this behavior changed in Vite 5! We'll take a look.

@natemoo-re natemoo-re added the - P3: minor bug An edge case that only affects very specific usage (priority) label Dec 6, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Dec 6, 2023
@matthewp matthewp assigned natemoo-re and bluwy and unassigned natemoo-re Dec 6, 2023
@bluwy
Copy link
Member

bluwy commented Dec 8, 2023

Closing as Vite 5.0.7 has been released. You can update the Vite version Astro uses with npm update vite

@bluwy bluwy closed this as completed Dec 8, 2023
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 a pull request may close this issue.

3 participants