Skip to content
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

changes to devDependencies that seem necessary for main to work #826

Closed
wants to merge 3 commits into from

Conversation

xinaesthete
Copy link

As of this writing, this is in a draft state - I want to verify that Vercel does indeed fail when changes to avivator dependencies aren't made.
Fixes #825

@xinaesthete xinaesthete changed the title changes that seem necessary for main to work changes to devDependencies that seem necessary for main to work Oct 2, 2024
@xinaesthete
Copy link
Author

https://viv-avivator-hq3v-git-avivator-vercel-xinaesthetes-projects.vercel.app/ LGTM. Pretty sure main in its current state fails without these changes.

I could really do with getting the other PR merged soon as I have deadlines and it's a bit of a blocker.

Cheers,
Peter

@xinaesthete
Copy link
Author

I notice there's also some other CI failing on main with some fairly trivial biome stuff;

  • it doesn't like single quotes in index.css
  • <div role="tabpanel" ... in Controller.jsx has an error " ✖ The element with this role can be changed to a DOM element that already this role." - changing to <tabpanel ... seems ok.

Also it doesn't show up in CI logs but I noticed a warning from biome that --apply is deprecated & to use --write instead.

@manzt
Copy link
Member

manzt commented Oct 2, 2024

I just made #827, which should resolve the biome stuff going forward. Sorry about that.

You should be able to merge in main and revert the fixes for the latest version of biome.

@xinaesthete
Copy link
Author

@manzt I did a git reset --hard on those commits & merged main.

Copy link
Member

@manzt manzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening a PR for discussion. I apologize if I'm missing some context, but it would be really useful to look at the logs from Vercel. I assume we're using some integration with Vercel on your fork to get previews of the various PRs you're opening.

While that's great, I also want to understand why we need to make these changes. It would be more useful to investigate your Vercel setup rather than make changes to Viv, especially since this isn't something we need to host.

I'm not an avid user of Vercel, but I understand they are very oriented around NextJS apps. Their "out of the box" setup tries to do some magic with installations and build steps. The purpose of devDependencies is to separate what's required in the website from what's required to build the website. This is useful for maintainers to understand the relationships between dependencies.

With Vercel, my understanding is that they assume you're making a NextJS app, and therefore they will "skip" devDependencies since they know what's typically required to build NextJS apps. Their default behavior is generally to only install production dependencies.

Have you specified a custom install command in your Vercel setup? I think pnpm install should do the trick. My guess is the default behavior by Vercel is to exclude development dependencies since they know the toolchain for NextJS apps.

@@ -34,7 +34,7 @@
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"esbuild": "^0.19.5",
"esno": "^4.0.0",
"gl": "^6.0.2",
"gl": "^8.0.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this causing an issue in Vercel or for you locally?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locally - couldn't pnpm i without this

@xinaesthete
Copy link
Author

xinaesthete commented Oct 2, 2024

To be honest I think I set the Vercel thing up ages ago and then I wasn't quite clear myself whether it was something I'd done or not.

So no - as of now I hadn't setup a custom install command etc as I somewhat assumed this was more generally relevant to you than it actually was.

@manzt
Copy link
Member

manzt commented Oct 2, 2024

To be honest I think I set the Vercel thing up ages ago and then I wasn't quite clear myself whether it was something I'd done or not.

No worries about the uncertainty with the Vercel setup. I'm fairly convinced this issue can be fixed with some configuration since we build and deploy Avivator in various platforms (GitHub CI, Netflify) and would prefer not to make changes that change the semantics and readability of our code base.

@manzt
Copy link
Member

manzt commented Oct 2, 2024

Let me have a look on Vercel now. I'll send a config that works (if I can get it going).

@xinaesthete
Copy link
Author

To be honest I think I set the Vercel thing up ages ago and then I wasn't quite clear myself whether it was something I'd done or not.

No worries about the uncertainty with the Vercel setup. I'm fairly convinced this issue can be fixed with some configuration since we build and deploy Avivator in various platforms (GitHub CI, Netflify) and would prefer not to make changes that change the semantics and readability of our code base.

Absolutely - I have no desire to interfere, it just seemed like there was something preventing main from working (which I didn't realise was peculiar to my setup).

So it does seem that the gl version was problematic - I have a fairly strong feeling that may be a macos (or maybe Apple Silicon) thing. I think that part should probably be merged, but I don't think you need to change anything to get my vercel thing working (I have a vague recollection that I originally tried to use netlify in a similar way and had some kind of problem leading me to try vercel instead - but this was quite a while ago).

The glsl-colormap in extensions package may warrant a moments thought; I don't know if it should be a devDependency or not.

@manzt
Copy link
Member

manzt commented Oct 2, 2024

Yah I definitely thing gl is an issue (classic node-gyp!). I'll have a look. I'm guessing we are on a newer version of node now and that's causing an issue.

The glsl-colormap in extensions package may warrant a moments thought; I don't know if it should be a devDependency or not.

Agreed, good catch.

@manzt
Copy link
Member

manzt commented Oct 2, 2024

Ok I got main working without any changes: https://avivator.vercel.app/

I think gl is a separate issue. This dependency is just used for running tests, and because it's based on onnode-gyp it requires Python to make binaries. This dependency isn't require for building the core libraries and Avivator.

I'm not sure what system vercel builds on, but the binaries for gl aren't pre-built for it (like your machine) and the install fails for various versions I've tried.

The following vercel.json should work (adding pnpm remove gl prefix to your custom install command):

{
  "buildCommand": "pnpm --filter=avivator build",
  "installCommand": "pnpm remove gl && pnpm build",
  "outputDirectory": "sites/avivator/dist"
}

or in the UI under your project settings:

image

Also make sure the Root Directory is blank.

image

Sorry for the workaround, but I'll work on a PR to fix up gl issue.

@manzt
Copy link
Member

manzt commented Oct 2, 2024

Should be able to remove pnpm remove gl part with #829

@xinaesthete
Copy link
Author

So I think this PR is probably redundant now and could be closed?

@manzt
Copy link
Member

manzt commented Oct 3, 2024

Yup! Let me know if you have trouble building avivator.

@manzt manzt closed this Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vercel deployment of avivator fails because of missing devDependencies in prod environment
2 participants