-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
vite build crashes due cryptic issues with path separators #886
Comments
Thanks for the bug report; don't hesitate to reach out when you hit such error. Insert the following before line function removePathSeperators(name) {
(0, utils_1.assertPosixPath)(name);
+ console.log('name', name);
(0, utils_1.assert)(!name.startsWith('/'));
const entryDir = 'entries/'; What's the log result? |
Thanks for looking into it. Since this happened inside a Vercel build, and I'm not enough of an expert to know how to monkey patch node_modules during a remote build with them I'm unable to share the result. I have however spent some time trying to repro this locally today and I've now succeeded - in the process I think I solved my mistake. I need to take a break for dinner and family time but I'll follow up later this evening with two or three repro scenarios. Stay tuned :) |
👍 Looking forward to these repros. |
Context
Scenario #1
// The only real changes to this file from ther defaults is
// the import ssr line and the ssr() invocation
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import ssr from "vite-plugin-ssr/plugin"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), ssr({prerender: true})],
})
vite dev
# VITE v4.3.6 ready in 1196 ms
#
# ➜ Local: http://localhost:3000/
# ➜ Network: use --host to expose
# ➜ press h to show help
vite build
# vite v4.3.6 building for production...
# ✓ 0 modules transformed.
# ✓ built in 10ms
# You must supply options.input to rollup
# error during build:
# Error: You must supply options.input to rollup
# at Graph.generateModuleGraph (file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:24795:19)
# at async Graph.build (file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:24740:9)
# at async file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:25761:13
# at async catchUnfinishedHookActions (file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:24914:20)
# at async rollupInternal (file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:25756:5)
# at async build (file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/dist/node/chunks/dep-a04f07ec.js:46453:18)
# at async CAC.<anonymous> (file:///C:/Users/Rocket/AppData/Roaming/npm/node_modules/vite/dist/node/cli.js:812:9)
NOTE: This isn't the same stack trace as my original submission - that's because this is the original issue that started my attempts to configure the plugin which eventually ended with the error message seen at the start of this. I'll add more details on Scenario #2 tomorrow. |
Done.
Let me know if you run into any other paper cut like this. |
Description
I'm a node/react noob and made a react app using pnpm and Vite - vite dev works fine. Tried to deploy on vercel which uses vite build. It's been a rabbit hole of troubleshooting since then but at the moment my "probably-not-the-right-vite-config-just-yet" generates the stack trace below with no helpful error message related to which path is "bad" nor what's "bad about it".
I fully accept this is likely misconfiguration on my side. I've read the guidelines and rules; submitting because you asked for stacktrace submissions that are unhelpful. I've also been trying to solve this for a couple of hours now and will continue trying.
Hope this helps improve the codebase!
vite.config.ts:
Stacktrace:
The text was updated successfully, but these errors were encountered: