Closed BatthewZ closed 1 week ago
Seems like the CLI is not correctly picking up that this is a Vite framework. This should likely be returning true if either the dependency or the configuration file exists. And add logic to add a configuration file if it doesn't exist.
@BatthewZ thank you for the issue. Can you confirm if there is a vite.config
file in the repo?
Having the same issue on a Next.js and Tailwind app. Are there any other workarounds for this?
// Off-topic but I was in bed and found a Reddit thread about Onlook. I spent so much time looking for something like this that I got out of bed to install and use it with my app lol.
Hoping for a fix soon! :)
@OutOfTokens @BatthewZ For now, you can manually install Onlook to your project instead. https://github.com/onlook-dev/onlook/wiki/How-to-set-up-my-project%3F#do-it-manually
npm i -D @onlook/nextjs
next.config.mjs
or next.config.js
with the swcPlugin line:
const nextConfig = {
reactStrictMode: true,
experimental: {
swcPlugins: [["@onlook/nextjs"]],
},
}
export default nextConfig
3. You can run your project regularly and Onlook will pick up your code changes.
@Kitenite Yo!
Yes, there is a vite.config.ts
. Admittedly this is an older 'playground/sandbox' project I just wanted to add Onlook to, but I could try spinning up a new project to see if it helps.
vite.config.ts:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
I'll look into the manual install, ty!
@BatthewZ , there’s a Vite demo here: https://github.com/onlook-dev/onlook/tree/main/demos/remix
Does this work?
@BatthewZ , I'm looking into this further.
Seems like the project should be picked up when vite.config.ts
exists and vite
is in dependencies. In this case, it is.
It's possible that glob does not work correctly for your current version of node node: 'v21.1.0'
. In this case, you could try to use Node 20 or Node >=22.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'glob@11.0.0',
npm WARN EBADENGINE required: { node: '20 || >=22' },
npm WARN EBADENGINE current: { node: 'v21.1.0', npm: '10.2.0' }
npm WARN EBADENGINE }
Otherwise, did the manual method work?
Describe the bug
Running npx onlook in my react typescript project fails and returns this:
This is my package.json:
It's worth noting, I am running in Windows OS (not WSL2), and the project path does have spaces in it (ie
D:\my code path\my_project
)