thgh / vercel-sapper

Vercel builder for Sapper with SSR enabled
MIT License
189 stars 25 forks source link

Error: The Root Directory setting is not supported for vercel-sapper #60

Closed mikenikles closed 2 years ago

mikenikles commented 3 years ago

Hi,

I have deployed to Vercel for months, but recently noticed the following error in the Vercel build logs:

19:51:56.378 | Cloning completed in 1179ms
19:51:56.381 | Analyzing source code...
19:51:56.383 | Warning: Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
19:51:56.717 | Error: The Root Directory setting is not supported for vercel-sapper

My Sapper app is in a sub-directory services/website and in the Vercel settings, I set the Root Directory to services/website.

I tried to move the vercel.json file to the root, but that resulted in Vercel build errors saying export is not a directory. Based on that, I assume Vercel ignored vercel-sapper and instead tried to use a static Sapper export.

Does anyone else run Sapper in a sub-directory and deploy with vercel-sapper?

Thanks,

Mike

thgh commented 3 years ago

What's in your vercel.json?

mikenikles commented 3 years ago

That's my vercel.json (source code):

{
  "version": 2,
  "builds": [
    {
      "src": "package.json",
      "use": "vercel-sapper"
    }
  ],
  "routes": [
    {
      "src": "/api/admin/(.*)",
      "dest": "https://admin-api.your-analytics.org/$1"
    },
    {
      "src": "/api/query/(.*)",
      "dest": "https://query-api.your-analytics.org/$1"
    }
  ]
}

It's quite odd as that exact setup worked in September. When I restarted to work on the project this week, the error showed up.

I'll keep looking into it and report here if I find anything.

mikenikles commented 3 years ago

The last successful deployment was 23 days ago. No code changes on my end since then. I opened a discussion at https://github.com/vercel/vercel/discussions/5633.

thgh commented 3 years ago

Not sure if helpful, but if your vercel.json is in the root directory, then you can do this:

  "builds": [
    {
      "src": "services/website/package.json",
      "use": "vercel-sapper"
    }
  ],

I have not used the Root Directory with vercel-sapper and I'm curious how to enable support..

antony commented 2 years ago

The vercel-sapper builder unfortunately required a fair bit of wrangling to get things in the right place for Vercel at the time, so it overrides a lot of the build configuration with values which work for Sapper.

As a result, more esoteric build setups such as this one aren't really supported (and I can't use pnpm, either).

Luckily we live in a SvelteKIt world now and as you know, builders are much simpler! I guess that makes this more of a wontfix?

mikenikles commented 2 years ago

Totally agree. I've migrated multiple Sapper apps to SvelteKit.

Closing as won't fix.