solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.1k stars 137 forks source link

In the new version, Route is imported as a type rather than a method. #434

Closed cppsh1t closed 1 month ago

cppsh1t commented 1 month ago

Describe the bug

I've set up a new Solid project and then installed the latest version of the router(0.13.4). Although the router is functioning properly, within vscode, Route is being imported as a type instead of a method. Then, I downgraded the router's version to 0.13.3, restarted vscode, and everything worked as expected.

Your Example Website or App

sry, i don't have

Steps to Reproduce the Bug or Issue

  1. pnpm create solid
  2. pnpm add @solidjs/router
  3. pnpm install
  4. use Router and Route

Expected behavior

no error in vscode

Screenshots or Videos

error1 error2

Platform

Additional context

No response

jpdutoit commented 1 month ago

I think this is due to my change #432

It is possible to export both with the same name, but it is confusing when they refer to different things. Since the Route type was not part of the public API before it can be safely renamed.

jsimonrichard commented 1 month ago

Created an reproduction repo before I saw this issue. Here it is in case it helps: https://github.com/jsimonrichard/solid-router-0.13.4-route-type-error-mre

mdddj commented 1 month ago

Same question