preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.02k stars 155 forks source link

router not linking if a file called routes.ts exists in the routes folder #303

Open AEnterprise opened 5 years ago

AEnterprise commented 5 years ago

trying to use preact-router 3.0.0, but it is not creating links, or accepting variables for paths

demo project: preact-demo.zip

if you open the page you get an undefined error from using a variable as path hardcoding it to a string works, and you can manually go to the url (once the serviceworker is installed)

but a tags created with (in the header component) do not work at all, looking at the html it makes an a tag, but doesn't actually give a href, making them unclickable

AEnterprise commented 5 years ago

for got to add stacktrace of the error: image

AEnterprise commented 5 years ago

after some more digging around on slack this turned out to be 2 problems: 1) you can't have any non component files in the reoutes folder, it turns them all into components when splitting, making things undefined 2) just the existance of a file called routes.ts in the routes folder makes it unable to generate links, even if said file is not imported/used