N
Nuxt3w ago
Yuri

Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

Hi. How can I hidden this warning. I use Nuxt & tailwindCSS.
7 Replies
kapa.ai
kapa.ai3w ago
Hi @Yuri. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- This warning is related to the upcoming changes in Dart Sass 2.0.0 and is a known issue in Nuxt projects. According to the information provided in the knowledge sources, this warning should be resolved in the next Nuxt release with the integration of Vite v6. In the meantime, there are a couple of approaches you can consider to handle this warning: 1. Wait for the next Nuxt release: As mentioned by a Nuxt team member in Github Issue: Dart Sass 2.0.0 Deprecation Warning (https://github.com/nuxt/nuxt/issues/30007), this issue should be resolved in the upcoming Nuxt release that includes Vite v6. 2. Use the warningIgnoreFilters option: You can add a filter to ignore this specific warning in your nuxt.config.ts file. Here's how you can do it:
export default defineNuxtConfig({
webpack: {
warningIgnoreFilters: [
warning => warning.message.includes('The legacy JS API is deprecated')
]
}
})

export default defineNuxtConfig({
webpack: {
warningIgnoreFilters: [
warning => warning.message.includes('The legacy JS API is deprecated')
]
}
})

This approach is based on the Nuxt Configuration documentation (https://nuxt.com/docs/api/nuxt-config#warningignorefilters), which allows you to filter out specific build warnings. Please note that while these approaches can hide the warning, they don't address the underlying issue. The best long-term solution is to wait for the Nuxt update that incorporates Vite v6, which should resolve this deprecation warning. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@740173469404364872> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Yuri
YuriOP3w ago
@kapa.ai warning => warning.message.includes('The legacy JS API is deprecated') It doesn't work. Do you have another idea?
kapa.ai
kapa.ai3w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I apologize that the previous suggestion didn't work. You're right, and I should have been more careful in my recommendation. Let's explore another approach based on the available information in the knowledge sources. Since you're using Nuxt with Tailwind CSS, and the warning is related to Sass, we can try a different method to suppress this specific warning. Here's an alternative approach: 1. Use the ignore option in your nuxt.config.ts:
export default defineNuxtConfig({
ignore: [
'The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0'
]
})

export default defineNuxtConfig({
ignore: [
'The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0'
]
})

This approach is based on the Nuxt Configuration documentation for the ignore option (https://nuxt.com/docs/api/nuxt-config#ignore). While it's typically used for ignoring files, we can attempt to use it for ignoring specific warning messages. 2. If you're using Nuxt UI, you can try disabling global styles:
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
disableGlobalStyles: true
}
})

export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
disableGlobalStyles: true
}
})

This is based on the Nuxt UI documentation (https://ui.nuxt.com/getting-started/installation#options). Disabling global styles might prevent the Sass-related warning, although it may affect your UI setup. 3. As a last resort, you could try updating your Sass dependencies to the latest versions, which might include fixes for this deprecation warning. However, I must emphasize that these are speculative solutions based on the limited information available in the knowledge sources. The most reliable solution is still to wait for the next Nuxt release with Vite v6 integration, as mentioned in the Github Issue: Dart Sass 2.0.0 Deprecation Warning (https://github.com/nuxt/nuxt/issues/30007). If these suggestions don't work, you might need to seek more specific help from the Nuxt community forums or GitHub issues, as the knowledge sources don't provide a definitive solution for this particular warning. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@740173469404364872> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
manniL
manniL3w ago
@Yuri will be resolved in vite 6 / Nuxt 3.15 It is because of the old sass lib used. You can also adapt manually if you want to
Yuri
YuriOP3w ago
Yes, I know about 3.15. Thank you )

Did you find this page helpful?