-
I'm trying to run an SPA with the base set to The steps are:
When I now build ( IssueHowever, when running in the dev mode ( [vite] Pre-transform error: Failed to load url /root.tsx (resolved id: /root.tsx) in virtual:remix/server-build. Does the file exist?
[vite] Pre-transform error: Failed to load url /routes/foo.tsx (resolved id: /routes/foo.tsx) in virtual:remix/server-build. Does the file exist?
[vite] Pre-transform error: Failed to load url /routes/_index.tsx (resolved id: /routes/_index.tsx) in virtual:remix/server-build. Does the file exist?
[vite] Error when evaluating SSR module virtual:remix/server-build: failed to import "/root.tsx"
|- Error: Failed to load url /root.tsx (resolved id: /root.tsx) in virtual:remix/server-build. Does the file exist?
at loadAndTransform (file:///<redacted>/spa-test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:53884:21)
at async instantiateModule (file:///<redacted>/spa-test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:54954:10)
[vite] Internal server error: Failed to load url /root.tsx (resolved id: /root.tsx) in virtual:remix/server-build. Does the file exist? The same error is happening with dev when a regular Remix app (with SSR enabled) is used. I tried to remove the Vite WorkaroundFor now, I ended up having two Vite configurations:
Does anyone have a hint what I'm missing here in the Vite config or is that a bug? Versions
Related to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Found it. It looks like the issue appears only for the |
Beta Was this translation helpful? Give feedback.
Found it. It looks like the issue appears only for the
base
/basename
with the value/app/
. 🤦 For every other values it is working fine. I assume that Vite/Remix plugin interferes with the default Remix source folder name. Will raise an issue.