Closed erights closed 1 year ago
With everything else built, when I go into the inter-protocol directory and do a local yarn build
I get exactly the same symptoms, including the successful error code at the end!
We isolated this to an import graph that strayed into the Node.js builtins. The yarn build
actually succeeded and was not the cause of any problems.
One new file in the contract's module graph did something like import { timerUtility } from '@agoric/swingset-vat'
, thinking to take advantage of packages/SwingSet/src/index.js
re-exporting timerUtility
from src/vats/timer/utility.js
. A deep import of @agoric/swingset-vat/src/vats/timer/utility.js
would have worked fine. But by (implicitly) importing index.js
, the bundling process was obligated to follow every import
from swingset's index.js
, which included swingset's controller.js
, which imports fs
and other Node.js builtins (none of which have any source, of course). We don't have any sort of tree-shaking here: every file named by an import statement (even if only imported for side-effects) must be included in the bundle, transitively.
I filed endojs/endo#1238 about improving the error message to help us track down such problems faster (showing the path of modules between the entry point and the missing one, so we can spot the point at which it meanders into unexpected territory).
@warner so it sounds like this can be closed?
yes; builds seem to be working now.
I did a
yarn && yarn build
at the top of agoric-sdk. This actual failure of myyarn build
is only on my local development copy. There is no reason think it is interesting. What is interesting is the masking of this error, which caused me to miss it for a long time. The end of myyarn build
looks likeHowever, on the way, in packages/inter-protocol, I see errors like
after 250 of these, I finally get