You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm going for a setup where I load all my libraries in as es6 modules in my main.js.
So far I was able to load in Alpine. Like: import Alpine from 'alpinejs'. And i've added pinecone-router-middleware-views and pinecone-router. But then it won't route me to the relevant view.
To Reproduce
Steps to reproduce the behavior:
This is my main.js
import'./style.css'// load this middlewareimport'pinecone-router-middleware-views'// Load routerimport'pinecone-router';importAlpinefrom'alpinejs'window.Alpine=AlpineAlpine.start()
Expected behavior
I expect that the /views/home.html is loaded for the root.
But this is not working.
But when I add the CDN link <script src="https://cdn.jsdelivr.net/npm/pinecone-router@2.x.x/dist/router.min.js"></script>, it is working. But i'd prefer to bundle my js.
Desktop (please complete the following information):
Ubuntu 22.10
Browser: chrome 108
The text was updated successfully, but these errors were encountered:
Hello, I just tried this with Vite and you're right it doesn't work by just importing pinecone-router directly I have missed that part in the README.
Like other Alpine.js plugins you need to add the router using Alpine.plugin()
here is how your main.js would look
// middlewares arent plugins import them directly.import'pinecone-router-middleware-views'// this is an Alpine.js plugin so import the exported PineconeRouterimportPineconeRouterfrom'pinecone-router';importAlpinefrom'alpinejs'window.Alpine=Alpine// add PineconeRouter as an Alpine.js pluginAlpine.plugin(PineconeRouter)Alpine.start()
Thanks for pointing it out and sorry for the inconvenience, I have update the readme accordingly.
Describe the bug
I'm going for a setup where I load all my libraries in as es6 modules in my main.js.
So far I was able to load in Alpine. Like:
import Alpine from 'alpinejs'
. And i've added pinecone-router-middleware-views and pinecone-router. But then it won't route me to the relevant view.To Reproduce
Steps to reproduce the behavior:
This is my main.js
This is what I have in my index.html
Expected behavior
I expect that the /views/home.html is loaded for the root.
But this is not working.
But when I add the CDN link
<script src="https://cdn.jsdelivr.net/npm/pinecone-router@2.x.x/dist/router.min.js"></script>
, it is working. But i'd prefer to bundle my js.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: