Comments (9)
Thanks for the issue. Seems like the issue lies with typescript
not resolving correctly from the npm package.
The import should work nicely, just the typing are missing. Pushing a fix!
from radix-vue.
That's weird. I have been using the namespaced components without issues even today.
Make sure you have installed version 1.2.0 or greater, since that's when namespaced components where added.
from radix-vue.
@ChrisGV04 yep, I have "radix-vue": "^1.4.6"
. I restarted VScode to make sure it's not caused by TS watcher. Still gettting the error
from radix-vue.
@ChrisGV04 the type error dissapears when I import it from dist:
import {Dialog} from 'radix-vue/dist/namespaced';
Instead of what's specified in the docs:
import {Dialog} from 'radix-vue/namespaced';
But then I get Vite error:
[plugin:vite:import-analysis] Missing "./dist/namespaced" specifier in "radix-vue" package
Not sure if it's meant to be exported from dist
or if it's just a typo in the docs
from radix-vue.
I'm not sure why you can't use radix-vue/namespaced
. I have been using it exactly as the docs say since I started using Radix Vue.
Here are some suggestions that I can think of:
- I use pnpm instead of npm or yarn. I don't know if this makes a difference.
- Try to add a
.npmrc
file to your project directory with this line:shamefully-hoist=true
then delete thenode_modules
and package-lock file and try to run install again. - Try adding
"type": "module"
to yourpackage.json
and reloading VS Code.
I have those on my own project using Radix Vue and it works perfectly
from radix-vue.
@ChrisGV04 it seems the type declaration for radix-vue/namespaced
is not exported from index.d.ts file of the package.
I have "type": "module"
specified. Probably shouldn't create .npmrc
just for one package.
Perhaps pnpm resolves missing types automatically somehow
from radix-vue.
Just checked the source code and it does export the namespaced types correctly.
If they weren't exported, it wouldn't work for anyone at all. But it works fine in my case.
I use Nuxt 3, so the .npmrc
is actually part of the starter template. I also had it on Vite projects, but I'm not sure if it could affect your app. I suggest you give it a try and revert the changes if it breaks something else
from radix-vue.
The namespaced types are exported in the node_modules/radix-vue/package.json
and can be found at node_modules/radix-vue/dist/namespaced/index.d.ts
.
from radix-vue.
@ChrisGV04 could you please take a look at my tsconfig? Is there anything wrong with it?
from radix-vue.
Related Issues (20)
- [Bug]: Nested UiMenus cannot be navigated when inside a focus trap HOT 6
- [Bug]: Hydration attribute mismatch in tabs component (SSR) HOT 3
- [Feature]: Make tabs component `v-model` generic HOT 2
- [Feature]: Make `<TabsRoot>`'s `modelValue` accept `string | number`
- [Bug]: Vue Transition with Combobox HOT 18
- [Feature]: Add provider functions as alternatives to provider components HOT 3
- [Bug]: Hydration children mismatch on Component with slots HOT 3
- [Feature]: DateField locale vs language vs format HOT 6
- [Bug]: `radix-vue/resolver` type export error
- [Feature]: Grid System Support HOT 2
- [Feature]: Add unit / pixel unit for panel size HOT 1
- [Feature]: Expose Toast remaining duration
- [Bug]: Popover component misses aria-label HOT 1
- [Feature]: Consider switching tabs on `@mouseup.left` instead of `@mousedown.left` HOT 2
- [Bug]: Combobox filtering stops working with a large amount of items
- [Feature]: the ability to disable switching the focus of a document to a DropdownMenuItem on hover
- [Bug]: Tabs and Resizable components do not work when I set `e.preventDefault()` in the `pointerdown` function HOT 2
- [Bug]: Tooltip not showing up when rendered on the server HOT 2
- [Bug]: Multiple tooltips displayed at once because of grace area
- [Feature]: Add `data-placeholder` to date picker input HOT 3
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 radix-vue.