Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Error when using @vitejs/plugin-react-swc #19

Open
krispya opened this issue Dec 20, 2022 · 7 comments
Open

Error when using @vitejs/plugin-react-swc #19

krispya opened this issue Dec 20, 2022 · 7 comments

Comments

@krispya
Copy link
Member

krispya commented Dec 20, 2022

I get the following error when attempting to start up the editor:
image

My vite.config:

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { r3f } from "@react-three/editor/vite";

// https://vitejs.dev/config/
export default defineConfig((env) => ({
  plugins: [env.command === "build" ? react() : r3f()],
}));

I am on Windows.
I am using Vite v4.0.0.

@krispya
Copy link
Member Author

krispya commented Dec 20, 2022

I confirmed that vite v4 does work. The problem is using @vitejs/plugin-react-swc insead of @vitejs/plugin-react.

@krispya krispya changed the title Get vite error when attempting to start up editor Error when using @vitejs/plugin-react-swc Dec 20, 2022
@nksaraf
Copy link
Collaborator

nksaraf commented Dec 21, 2022

So the earlier error was vite 4 + swc and works with vite 4 + babel.. did u try with vite 3 as well?

@krispya
Copy link
Member Author

krispya commented Dec 21, 2022

I did not, I can try this configuration later.

@nksaraf
Copy link
Collaborator

nksaraf commented Dec 27, 2022

vitejs/vite#9986 could be related to this

@wanghqwe
Copy link

resolve: {
   preserveSymlinks: true,
},

work for me

@prjwlbadwe
Copy link

  1. Open Command Palette: Command + Shift + P.
  2. Search TypeScript: Restart TS server.
  3. Press Enter.

@AlejandroWogelman
Copy link

I confirmed that vite v4 does work. The problem is using @vitejs/plugin-react-swc insead of @vitejs/plugin-react.

Thanks!! I had the following error "[vite] Internal server error: Bindings not found." Changing @vitejs/plugin-react-swc to @vitejs/plugin-react solved it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants