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

Where to intercept the dev env warnings? #2

Closed
kobe-ra opened this issue Feb 17, 2024 · 1 comment
Closed

Where to intercept the dev env warnings? #2

kobe-ra opened this issue Feb 17, 2024 · 1 comment

Comments

@kobe-ra
Copy link

kobe-ra commented Feb 17, 2024

hi, i believe we all are receiving these warnings:

image

i've been trying to catch them at some places in this package so we could create a setting at createInertiaApp function, where user would list their specific warnings and they would've been disabled for dev env. well, they are not present in prod env anyway.

if you have idea where could these be intercepted, please let me know and i'd make a pr.

i did something similar with ziggy's routes which svelte compiler doesnt like, because they are undefined. solved in vite.config.js like this:

svelte({
    onwarn: (warning, handler) => {
        if (warning.message.includes("'route' is not defined")) return;
        handler(warning);
    },
}),
@punyflash
Copy link
Member

Refer to sveltejs/svelte#4652. Currently, there is no way inside svelte compiler to omit these errors. And to be honest, a lot of devs thinks they are annoying, but I think they are quite helpful. They not end up in production after app build, so I don't see them cause any trouble. Just ignore them if you do not need to use those props.

@punyflash punyflash closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2024
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

No branches or pull requests

2 participants