Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-unity-webgl conflicts with vite-plugin-istanbul option (unity stops working) #465

Open
1 of 2 tasks
dmorenoAN opened this issue Nov 17, 2022 · 0 comments
Open
1 of 2 tasks
Assignees
Labels

Comments

@dmorenoAN
Copy link

dmorenoAN commented Nov 17, 2022

Please avoid duplicates

Language and Compiler

Other TypeScript compiler

What environment are you using?

Local Development Server

When does your problem occur?

While the Unity App is loading

What does your problem relate to?

I don't know

React-Unity-WebGL Version

9.2.1

React Version

18.2.0

Unity Version

2021.1.16f

What happened?

Hi, i have been in a trouble with the thing mentioned in title. This plugin has conflicts with "vite-plugin-istanbul".

Not working code

export default defineConfig({
  plugins: [react(), svgr(), istanbul({ cypress: true, requireEnv: false })],
  server: {
    port: 8000,
    host: "0.0.0.0",
  },
});

Working code

export default defineConfig({
  plugins: [react(), svgr(), istanbul({ cypress: true, requireEnv: true})],
  server: {
    port: 8000,
    host: "0.0.0.0",
  },
});

I would like to know why is this happening, it seems to have no-relation. The option failing if false is requireEnv.

Thanks.

Reproducible test case

//App.tsx
import React from "react";

import { Unity, useUnityContext } from "react-unity-webgl";

function App() {
  const { unityProvider } = useUnityContext({
    loaderUrl: "xxx",
    dataUrl: "xxx",
    frameworkUrl: "xxx",
    codeUrl: "xxx",
  });

  return (
    <div className="App">
      <Unity unityProvider={unityProvider} />
    </div>
  );
}

export default App;
//vite.config.ts

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import istanbul from "vite-plugin-istanbul";

export default defineConfig({
  plugins: [react(), istanbul({ cypress: true, requireEnv: false })],
});

Would you be interested in contributing a fix?

  • yes, I would like to contribute a fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants