-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Import protection #12793
Comments
Is there any more progress on this issue? This seems to be related to an issue I'm having. My Initially, the code had filtering, sorting & limiting and I've tried all variations of these three with the argument in the method call, with no joy. My content config is as follows:
As you can see, nothing too extravagant going on. The code doing the actual call is:
However, as stated previously, I have tried the above without the filtering, sorting and limiting with no success. The code is added as part of a setup script blog in a standard SFC, rather than a layout file or page component. To attempt to narrow things down further, I've also attempted with server-side fetching turned off and I've also tried exposing the refresh/execute method on |
My complete component code currently looks like:
As you can see, I've implemented numerous extra functionality to try and rule out various any other parts of the code that could be causing the issue however, as long as PS: I know you're probably throwing up in your mouth at the site of this code, mixing camel/kebab case for tag names, etc. I can only apologize for that. 😁 |
@codetheorist Would you open a new issue with a reproduction? |
At the moment, I've setup a base app with the minimal required config and the issue is no longer occuring. Therefore, I believe the issue is with another module, such as Sidebase Auth OR I18N. I'll keep investigation and see where this leads. When I come to a conslusion, if said conclusion isn't human stupidity at it's greatest form (me), then I shall push the code for you to investigate further. @danielroe |
Thank you! If it’s a third party module, importing from Nuxt Kit into runtime code deliberately causes this error (because it shouldn’t be bundled). |
Importing build dependencies (such as
nuxt.config
or@nuxt/kit
) inside the app source code can result in misleading errors and unexpected issues. While we cannot avoid it in general, we can mitigate this mistake for common issues using aliases redirecting to a module throwing error or resolver hook that throws error instantly.Another idea we can do is use documentation by adding warnings to TSDocs but still, users can simply not see it or ignore it in some cases. Also for doing this, we basically need to add warning to every possible import which is not possible.
App import protections: (webpack, vite)
@nuxt/kit
,@nuxt/nitro
, ...)nuxt
/nuxt3
#storage
nuxt.config
server/*
filesimport x from '@nuxtjs/axios'
)@vue/composition-api
in a Nuxt 3 application (Failed to resolve import "#build/plugins" when adding alias for@vue/composition-api
#12683)Nitro import protections: (nitro's rollup)
#app
The text was updated successfully, but these errors were encountered: