aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
16.09k stars 561 forks source link

Million fails with Remix SPA mode #890

Closed Abbbdab closed 5 months ago

Abbbdab commented 6 months ago

What version of million are you using?

2.6.4

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

windows

What browser are you using?

Chrome

Describe the Bug

Setting up Million with a Remix SPA fails. Here is the sample code:

import { unstable_vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import million from "million/compiler";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
  plugins: [
    million.vite({
      auto: true,
    }),
    remix({
      unstable_ssr: false,
    }),
    tsconfigPaths(),
  ],
  server: {
    port: 3000,
  },
});

The error received is:

[vite] Error when evaluating SSR module virtual:remix/server-build: failed to import "/app/routes/_app.sites.$x.$y.$z.$ab.details/route.tsx"

What's the expected result?

It should integrate with Remix SPA same way it does with a Vite+ React SPA and work.

Link to Minimal Reproducible Example

https://remix.run/docs/en/main/future/spa-mode

Participation

github-actions[bot] commented 6 months ago

Thanks for opening this issue! A maintainer will review it soon.

tobySolutions commented 6 months ago

You could try setting server: true as well, but, then again a reproduction of the issue would as well be helpful.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.