So I’m trying to build my company’s module, and it seems to be working on my boss’ machine, but can’t get it working on mine. I was able to build some of the examples on github.
The issue I’m running into is as follows:
/* snip */
> Task :web:yarn
yarn install v1.15.2
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://nexus.inductiveautomation.com/repository/node-packages/@inductiveautomation/perspective-designer/-/perspective-designer-1.0.3.tgz: certificate has expired".
info If you think this is a bug, please open a bug report with the information provided in "C:\Users\myusername\projectpath\ourmodulename\web\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> Task :web:yarn FAILED
FAILURE: Build failed with an exception.
/* snip */
Unfortunately, I can’t include the log file, as it’s about 10x the size of what’s allowed here.
Any help is appreciated, I’m not sure where to go from here.
Thanks for posting that. I just pushed a pull request to github.com/inductiveautomation/ignition-sdk-examples/ with some updates for the perspective example component. Can you try updating the dependency versions of your repo to be consistent with that?
Meanwhile, I’m not able to reproduce what you are seeing. Let’s try updating to current versions, and if doesn’t resolve the problem for you, we’ll figure out next steps.
I was able to get the perspective-component on the latest repo to build. I’m working on a module developed from prior to the latest.
How can I go about updating all of the necessary dependencies to get it up to date with the repo?
There are going to be three ‘sets’ of dependencies to update: The java (Ignition SDK) dependencies, which are found in build.gradle files, the ‘web’ (aka javascript/browser/npm/nodejs/yarn/typescript) dependencies, which are found in the web/packages/client/package.json and web/packages/designer/package.json, and finally, the ‘build’ dependency versions for the web tools (nodejs, npm, yarn), which will be in BOTH one or more package.json devDependencies, and encoded in the build.gradle file for the web subproject.
There’s no single ‘best’ way to update dependencies in a polyglot project like this – you just kind of do it, and try to deal with any issues you come across in the process. I’d personally start by upgrading the tool versions (in the web build.gradle and package.json devDependencies), run a build and make sure it assembles ok (may want to run the ‘clean’ task first). Then upgrade the sdk versions in the build.gradle files, again, build and make sure things compile. Then, upgrade the versions in the package.json.
I personally do all the above manually. It’s not fun, and can be very time consuming when dealing with the web dependencies due to how poorly the nodejs dependency management works. Unfortunately, that’s really all we can do without any alternatives. Make sure to make a commit with each step so you can easily ‘undo’ changes easily.
Perspective is by far the most complex build we have for a module, and challenging dependency maintenance is something you’ll have to learn to be comfortable with if you’re maintaining modules for it. Learning and understanding the tooling (gradle, node, npm/yarn, webpack) is crucial if you want to avoid have a really bad time of it.
The web world moves really fast, and as much as I’d love to be more ‘hands off’ in maintaining dependencies, we need to move with it. If you’re maintaining a module, it would definitely benefit you to update it with each ignition release, to stay consistent the dependencies we list in the package.json of the @inductiveautomation/perspective-client and @inductiveautomation/perspective-designer we publish with the sdk.