-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Build fails using adapter-vercel #7245
Comments
Can you add a |
|
That sounds like something inside |
package.json:
|
What happens if you adjust the code in // replace line 318 with
const result = match.exec(error.message);
if (!result) {
return;
} The build probably succeeds then, I'm wondering if this has any impact on your deployed app. |
Sorry, had to sleep ;) Hopefully I did that right: if (error.message.startsWith('Failed to resolve dependency')) {
const match = /Cannot find module '(.+?)' loaded from (.+)/;
console.log(error.message)
// const [, module, importer] = match.exec(error.message);
//
// if (!resolution_failures.has(importer)) {
// resolution_failures.set(importer, []);
// }
const result = match.exec(error.message);
if (!result) {
return;
}
resolution_failures.get(importer).push(module);
} else {
throw error;
} I am getting this:
|
Sorry, I didn't paste the full code, there's one line missing at the end. It should be if (error.message.startsWith('Failed to resolve dependency')) {
const match = /Cannot find module '(.+?)' loaded from (.+)/;
console.log(error.message)
// const [, module, importer] = match.exec(error.message);
//
// if (!resolution_failures.has(importer)) {
// resolution_failures.set(importer, []);
// }
const result = match.exec(error.message);
if (!result) {
return;
}
const [, module, importer] = result; // <- was missing
resolution_failures.get(importer).push(module);
} else {
throw error;
} |
Ah that makes more sense. Here's a new one:
|
I should have read that code snippet more closely ... 😄 This one goes through hopefully.. if (error.message.startsWith('Failed to resolve dependency')) {
const match = /Cannot find module '(.+?)' loaded from (.+)/;
console.log(error.message)
// const [, module, importer] = match.exec(error.message);
const result = match.exec(error.message);
if (!result) {
return;
}
const [, module, importer] = result;
if (!resolution_failures.has(importer)) {
resolution_failures.set(importer, []);
}
resolution_failures.get(importer).push(module);
} else {
throw error;
} |
Ok, the build did go through with that, but I did get this at the end.
I guess I should try to deploy this, but I'll have to figure out how to deploy manually to vercel since I have just been using the GH action 🤣. |
Hmmm, as far as I can tell from the docs, the only "manual" deployments are using the cli which just uploads the source code to vercel to build it. So, none of the changes to npm packages of course. Is there a simple(ish) way to temporarily swap it out? |
https://www.npmjs.com/package/patch-package this should do the job |
Success! What does this mean for adapter-vercel? Is this change good for everyone using the package? If so, I can create a pr with the change. |
I created vercel/nft#315 first because I think that's the source of this issue |
So I updated my app to use this new version without the patch. Build works, but now I get this cryptic error message.
|
Yes, we left that in as a warning to notify people that something may not work - but if it does you can ignore it. It's a warning, not an error, so the build succeeds. |
Describe the bug
I am working on updating one of my apps (from 367). Finally got it all working in
pnpm dev
, so I go to build and... fail. I have been racking my brain but unfortunately I haven't been able to pin down exactly why. It seems that it is something with the adapter itself, but obviously not all adapter-vercel builds are failing, so maybe it is something on my end. Ahh! 😕 Maybe this has been seen before and there is a known solution? 🤞🏻The vite part of the build works fine, so
pnpm preview
works, just not the final build. I have also tried building with adapter-node which worked as expected and even adapter-netlify which worked, although I did not deploy it.Reproduction
Sorry, no repro. I have not been able to pin down exactly what is causing this. Feel free to close I guess but just frustrating since I deploy to vercel. I would just say it is obviously something on my end, but it is weird that adapter-node and adapter-netlify build successfully if that is the case.
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: