Closed skilesare closed 6 months ago
Hi @skilesare
I tried to reproduce this with mops.toml
:
[dependencies]
map9 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v9.0.1@10b68f6ea8df5e72dfa4c07a50c8bb60a916c233"
and package.json
{
"scripts": {
"postinstall": "mops sources"
}
}
and when I run npm install
I get no errors.
Could you provide a full mops.toml file that I can play with?
Pretty simple:
[dependencies] base = "0.10.4" map9 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v9.0.1" account = "1.0.1"
I'm using this as the starter project which may be helpful because I only ever see these when trying to run the vite dev server or some other npm command: https://github.com/rvanasa/vite-react-motoko cc @rvanasa
And now today randomly I'm getting this:
The build step failed for canister 'br5f7-7uaaa-aaaaa-qaaca-cai' (backend) with an embedded error: Failed to build Motoko canister 'backend'.: Failed to load package arguments.: The command '"mops" "sources"' failed with exit status 'exit status: 1'. Stdout:
Stderr: node:internal/process/promises:279 triggerUncaughtException(err, true / fromPromise /); ^
HTTPError: Response code 404 (Not Found)
at Request._onResponseBase (file:///cycles-ledger-integration-poc/node_modules/got/dist/source/core/index.js:706:31)
at Request._onResponse (file:///cycles-ledger-integration-poc/node_modules/got/dist/source/core/index.js:765:24)
at ClientRequest.
[Symbol(context)]: [Circular *1]
}
},
pagination: {
transform: [Function: transform],
paginate: [Function: paginate],
filter: [Function: filter],
shouldContinue: [Function: shouldContinue],
countLimit: Infinity,
backoff: 0,
requestLimit: 10000,
stackAllItems: false
},
setHost: true,
maxHeaderSize: undefined,
signal: undefined,
enableUnixSockets: true
},
_merging: false,
_init: [ { isStream: true } ]
} }
Got it, there is too old local ic-mops
npm dependency that does not support new #<branch>@<hash>
syntax
Replacing "ic-mops": "^0.17.2",
with "ic-mops": "^0.39.2",
should work
mops --version CLI 0.39.2 API 1.2
If my mops file has a github URL with no hash, no problem:
ie map9 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v9.0.1"
Once I run mops update and get a hash at the end I start getting errors:
map9 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v9.0.1@10b68f6ea8df5e72dfa4c07a50c8bb60a916c233"
If I run mops sources by it self, things seem to work. If mops sources is run as part of a postinstall via npm I get the below error: