Comments (2)
The reason is that Nitro + the Vue part of your app are separate contexts. They therefore deliberately have different auto-imports. If you have a file which exports 'safe' utilities that can both be used in server routes and in the Vue part of your app, you can add the directory to both imports.dir
and nitro.imports.dirs
.
It's not a bug but I realise it's a bit confusing. Maybe we can improve the docs here?
from nuxt.
@danielroe thanks for the clarification. It makes sense that there are separate configurations. And yeah, it would be nice to have it clearer on the docs :)
FYI, I referred to these two pages:
- https://nuxt.com/docs/guide/concepts/auto-imports
- https://nuxt.com/docs/guide/directory-structure/composables
from nuxt.
Related Issues (20)
- When non-existing URL is visited then "No match found for location with path" is logged 8 times HOT 6
- app.config.js - defineAppConfig is not defined HOT 5
- Error TS18028 during tsc in Nuxt 3 HOT 1
- When I set ssr to false, configured dynamic route [...slug].vue , click into the sub-page is normal, when I refresh in the sub-page appears in the picture, the link in the parameter for /classify/1/1 , classify for the route, /1/1 for the parameter, at this time to refresh on this error HOT 1
- Hello World example from doc not working HOT 1
- Server components cause hydration error when used inside resolved component HOT 1
- context.outputFileSystem.lstat is not a function HOT 8
- Nuxt > 3.8.1 <client-only> showing blank with "builder: webpack" HOT 4
- "joinRelativeURL" is not exported by "../../node_modules/ufo/dist/index.mjs", imported by "virtual:nuxt:C:/Users/MyPc/Workspace/my-project/apps/my-app/.nuxt/paths.mjs". HOT 2
- set `{ deep: false }` by default for data fetching composables HOT 1
- Improved Directory Structure HOT 44
- Minimize NuxtLink Size
- [Bug] [`@vue/compiler-sfc`] Read files based on Nuxt project/VFS in a monorepo HOT 1
- Add ability to prerender pages without including them in routes HOT 1
- After the first page jumps to the second page, click the back button again, the keep-alive of the first page does not take effect, and return to the first page still requests data again. HOT 1
- nuxt-client attribute doesn't hydrate a component inside a server component HOT 3
- Browser console warning when debugging HOT 1
- CSS HMR errors from Tailwind arbitrary value classes HOT 3
- 3.11.1 Pinia not working HOT 2
- Template installation error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.