# Piny 'Click to select' not working: Piny plugin order with tanstack in vite?

**URL:** <https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720>\
**Category:** Piny\
**Created:** [May 28, 2026, 2:04pm UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720 "2026-05-28T14:04:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vips](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@vips](https://forum.pinegrow.com/u/vips)\
**Post date:** [May 28, 2026, 2:04pm UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/1 "2026-05-28T14:04:42Z")

</div>

Hi team, it’s a wonderful project but recently i have been having trouble getting Piny to work with a tanstack app created with vite. the specific issue is that i cannot get ‘Click to select’ to work.  
I suspect the plugin order in vite.config.ts maybe the issue.

here is the current (not working) vite config.

is there a workaround i can try?

thank u.

```auto
import { defineConfig } from 'vite'
import { devtools } from '@tanstack/devtools-vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import PinyVite from '@pinegrow/piny-vite'

const config = defineConfig({

resolve: { tsconfigPaths: true },

plugins: [ 

devtools(),

tailwindcss(), 

tanstackStart(), 

viteReact(),

PinyVite()  

  ]

})

export default config

```

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [May 29, 2026, 8:55am UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/2 "2026-05-29T08:55:39Z")

</div>

I just tried tanstack with piny, and it works for me - [GitHub - TechAkayy/tanstack-vite · GitHub](https://github.com/TechAkayy/tanstack-vite). Can you give this repo a shot.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/1/1284807260733aa1e7a26853504cba20438651b0.png)

---

<div class="post-metadata">

**Author:** ![vips](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@vips](https://forum.pinegrow.com/u/vips)\
**Post date:** [May 31, 2026, 1:07pm UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/3 "2026-05-31T13:07:02Z")

</div>

thanks for the followup. your repo is great and works for me.

the default vite command to install tanstack router insists on installing tanstack Start (the template). this interferes with injecting piny into the page.

i found out you need to add {import.meta.env.DEV && } in \_\_root.tsx as below.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/6/61d857f7a8c1a62df9e31ccde3c726fd2a805ad3.png)

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [June 1, 2026, 2:32am UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/4 "2026-06-01T02:32:18Z")

</div>

I didn’t quite catch the issue with your setup.

If you check `node\_modules/@pinegrow/piny-vite/dist/index.js`, the runtime path is automatically injected (screeenshot below). Does you setup does something that interferes with this? Your feedback is welcome, so that we can improve our setup. Thanks!

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/5/5e7f5653a440e556f0420297a738497cb850f4d8.png)

---

<div class="post-metadata">

**Author:** ![vips](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@vips](https://forum.pinegrow.com/u/vips)\
**Post date:** [June 8, 2026, 8:29am UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/5 "2026-06-08T08:29:41Z")

</div>

hi @TechAkayy ,

apologies for the delay in replying.  
i setup a ‘tanstack router’ app and selected all the other tanstack modules: DB, Form, Table, Store, Query.

i’m using yarn, so i added ‘Click to Select’ with: ‘yarn add @pinegrow/piny-vite --dev’

 ![testtanstack9 2](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/f/f5cdfd0f64c765f1ec320d16a99ad11f073ac696.jpeg)

after adding Piny() to the vite config and running the app, Piny doesn’t inject.

---

<div class="post-metadata">

**Author:** ![vips](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@vips](https://forum.pinegrow.com/u/vips)\
**Post date:** [June 8, 2026, 8:30am UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/6 "2026-06-08T08:30:17Z")

</div>

![tanstackinspect 2](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/8/81087194032492dadc00c0488e085068a1ce1a82.jpeg)

---

<div class="post-metadata">

**Author:** ![vips](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@vips](https://forum.pinegrow.com/u/vips)\
**Post date:** [June 8, 2026, 8:31am UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/7 "2026-06-08T08:31:04Z")

</div>

![piny_viteconfig.jpeg](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/8/88ccc446dc5e21ed2768794d000793c5fbbace5d.png)

i tried various plugin orders but none work.

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [June 9, 2026, 11:01pm UTC](https://forum.pinegrow.com/t/piny-click-to-select-not-working-piny-plugin-order-with-tanstack-in-vite/11720/8 "2026-06-09T23:01:47Z")

</div>

Thanks @vips. That was very useful. Our piny vite plugin uses `transformIndexHtml` to inject piny into the shell `index.html` which is present in vanilla tanstack app (my git repo), while in the full tanstack app you shared, there is no shell, and is generated dynamically. We will patch it up to cover this scenario if possible. cc: @matjaz

Meanwhile, your hack adding it to \_\_root.tsx was a smart one. Thanks for sharing.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/8/83bdb113697d7b6ca2a2bcc8a555b6bf8ddb66df.png)
