-
Notifications
You must be signed in to change notification settings - Fork 1.4k
align dependencies so there isn't mixed versions of the ajv subdependency causing errors
#6559
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
align dependencies so there isn't mixed versions of the ajv subdependency causing errors
#6559
Conversation
… versions of ajv being used by subdepdendencies when running the 'npm run build' target. while the lockfile should prevent this, this can happen when people's build environment is using an older node_modules cache. the cleanest way to fix this for users without manual steps from them is to bump the ajv-referencing packages. with newer eslint and prettier, there are bug fixes where it finds latent problems they missed before. I haven't modified the rule configuration of either, and did the most reasonably minimal fixes for things like unused-variable in error handlers.
…lightly worrying.
…r now. an 'esm' slipped in, causing a crash when running ava tests.
|
After running Then the build succeeds, and runs without any initially noticeable errors (https://hubs.hominidsoftware.com/v6tN9xi/treadmill-animals) |
|
The code changes look good (aside from the noted sections) — more error trapping and better log messages are always good. |
…o make 'npm test' pass in admin dir without running 'npm ci'. 'npm build' in admin dir will not work if 'npm ci' isn't run first.
Interesting. Is it expected that 'npm test' would work before running 'npm ci'? in this case, it seems to use the node_modules in the base directory, and there was a newer React there. I've pushed a fix that aligns the React version in admin module with the base directory, and adjusts to the React 18 API change in the error message above. |
That entirely depends on what npm test does. Usually, you expect to run
If I understand the docs correctly, this is not supposed to happen. Npm is parsimonious, but only within a single node_modules directory: https://docs.npmjs.com/cli/v9/configuring-npm/folders?v=true#cycles-conflicts-and-folder-parsimony However, if there is no node_modules directory at all in admin, npm will just use the node_modules directory in the root directory. |
|
The latest version passes the automated tests in the root directory. Unfortunately, it currently doesn't build for me: It looks like admin/package.json and admin/package-lock.json are not in sync. After running Running |
…and the root: react-admin doesn't support past React 16, and upgrading it has some ripple effects to material-ui. This is a good candidate for the next upgrade slice.
|
Ok! In this version, both sets of tests pass, it builds without errors, and a room can be entered, with no obvious problems! |
DougReeder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a little more smoke testing, I think we can merge this.
|
Ah, but this PR should be against the |
|
@DougReeder Uh, the |
|
You’re right, I was confusing the hubs and hubs-cloud repos. Whew!Doug ***@***.*** Jun 28, 2025, at 1:11 AM, Exairnous ***@***.***> wrote:Exairnous left a comment (Hubs-Foundation/hubs#6559)
@DougReeder Uh, the dev branch here is really old, I don't think we want anything based off of it. As far as I know the only repository that has/needs an active development branch is the hubs-cloud repository (although the hubs-discord-bot may need one too depending on how we decide to release it to the public). Unless there's something specific you wanted from the dev branch here? (I see it has diverged from master by six commits)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
awesome. Merge when ready :) |
Exairnous
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deployed this to my Community Edition instance (using the Custom Docker Build Push GitHub Action) and the main page/loading a room seems to work okay, but the admin screen errors out for me (Firefox 136.0.1 Linux) when I visit it and doesn't render (all I get is a white screen).
hubs-pr-6559-admin-error-log-2025-07-08.log
|
It looks to me like the problem could be that when the node version for admin was reverted back to 16 the changes to Note: this only the initial impression I got from looking at the code and recent commits, I haven't explored any further and haven't tested anything. |
|
I also see the admin pages failing to load. The console problems start with a warning and an error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data :1:145535 Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. |
If we have to stick with React 16 for now, we can't use createRoot. At least it appears to be used in only one place. |
|
@matthargett The latest change still errors out for me :(
|
…le with console.error and exend the error modal timeout to a full 10 seconds.
|
@matthargett That fixed it on my end. Thanks! Everything seems to be functioning normally in the admin panel now. I still get the following error, but it doesn't seem to prevent anything from working (still, it would be nice to get rid of, if possible).
|
|
@matthargett Ah, I just checked and that JSON syntax error is because of the |
|
Just noticed there's also some linter errors reported by the |
|
For me, the latest version load and runs a room properly, but the Admin page fails to load with these errors: XHRGET SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data :1:145535 Resource URL: https://hubs.hominidsoftware.com/%3Canonymous%20code%3E Uncaught (in promise) TypeError: i.H is not a function The last error is thrown by line 238 of admin.js, which is
This is running in Firefox 140.0.4 under MacOS Sequoia 15.5 |
this was fixed in the next push. I just verified lint is clean :) |
that was with the latest code pulled? can you tell me the git commit hash at the top of |
fixed. |
|
I tried building in a different copy of the repo, and now it appears to work fine. 😒 |
|
Thanks for testing! Please merge when ready! |
Exairnous
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good.
A couple small nits I found:
reasonMessage showed the string of an object instead of the actual object when I simulated a network error, is this expected?
Unhandled Promise Rejection:
Object { reasonMessage: "[object Event]", stack: undefined }
reasonMessage: "[object Event]"
stack: undefined
<prototype>: Object { … }
admin.js:61:10
<anonymous> admin.js:61
(Async: EventListener.handleEvent)
<anonymous> admin.js:60
<anonymous> admin.js:356
<anonymous> admin.js:356
Also, I wasn't able to figure out how to trigger the "HTTP Error in data provider" to test the changes to it, but since it's already throwing an error it should be fine even if there were some issue.
|
Thanks for all your work! This was a real bear. |
Why: So errors in the log can be mapped to the line of code where it happened
DougReeder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your hard work!


What?
aligns direct package upgrades so there isn't a conflict between uses of multiple versions of the
ajvlibrary.Why?
in the giant dependency update branch, a user hit a problem with conflicting versions of ajv being used by subdepdendencies when running the 'npm run build' target:
while the lockfile should prevent this, this can happen when people's build environment is using an older node_modules cache. the cleanest way to fix this for users without manual steps from them is to bump the
ajv-referencing packages. with newer eslint and prettier, there are bug fixes where it finds latent problems they missed before. I haven't modified the rule configuration of either, and did the most reasonably minimal fixes for things like unused-variable in error handlers.Examples
How to test
npm run testin root and admin directoriesshould have zero effect on the web apps themselves, but I tested storybook and default hubs page locally just to be sure.
Documentation of functionality
no docs necessary for end users or maintainers.
Limitations
this aligns the easy packages that reference the conflicting
ajvversions that aren't disruptive (e.g. requires accommodating ES modules).Alternatives considered
I tried using
overridekeys in package.json, but there are breaking changes in ajv 8.x that will cause eslint to break. upstream eslint maintainers appear to be aware of this as a challenge in their ecosystem.Open questions
Additional details or related context
relates to #6549 , carves out a thin slice that should help reduce that PR a bit