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

yarn start:contract fails: TypeError#1: Cannot delete property 'dispose' of function Symbol #43

Closed
kbennett2000 opened this issue Jan 10, 2024 · 2 comments · Fixed by #51

Comments

@kbennett2000
Copy link

Running the yarn start:contract command returns the following error:

agoric@AgoricVM:~/Desktop/demo$ yarn start:contract
yarn run v1.22.21
$ cd contract && yarn start
$ yarn docker:make clean start-contract print-key
$ docker compose exec agd make -C /workspace/contract clean start-contract print-key
make: Entering directory '/workspace/contract'
./scripts/build-proposal.sh
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
agoric: run: running /workspace/contract/scripts/build-game1-start.js
start-game1-proposal.js module evaluating
SES Lockdown using options from environment variables "LOCKDOWN_OVERRIDE_TAMING"
Removing intrinsics.Symbol.dispose
failed to delete intrinsics.Symbol.dispose (TypeError#1)
TypeError#1: Cannot delete property 'dispose' of function Symbol() { [native code] }

(TypeError#1)
agoric: (Error#1)
Error#1: bundle-source failed with status 255
  at makeError (file:///usr/src/agoric-sdk/node_modules/ses/src/error/assert.js:243:17)
  at fail (file:///usr/src/agoric-sdk/node_modules/ses/src/error/assert.js:357:20)
  at Fail (file:///usr/src/agoric-sdk/node_modules/ses/src/error/assert.js:366:39)
  at createBundlesFromAbsolute (file:///workspace/node_modules/@agoric/internal/src/node/createBundles.js:41:11)
  at createBundles (file:///workspace/node_modules/@agoric/internal/src/node/createBundles.js:50:10)
  at getBundle (file:///workspace/node_modules/@agoric/deploy-script-support/src/writeCoreProposal.js:60:13)
  at install (file:///workspace/node_modules/@agoric/deploy-script-support/src/writeCoreProposal.js:67:22)
  at game1ProposalBuilder (file:///workspace/contract/scripts/build-game1-start.js:19:11)
  at writeCoreProposal (file:///workspace/node_modules/@agoric/deploy-script-support/src/writeCoreProposal.js:90:14)
  at default (file:///workspace/contract/scripts/build-game1-start.js:33:9)
  at async file:///usr/src/agoric-sdk/packages/agoric-cli/src/scripts.js:188:7
  at async Command.parseAsync (/usr/src/agoric-sdk/packages/agoric-cli/node_modules/commander/lib/command.js:935:5)
  at async main (file:///usr/src/agoric-sdk/packages/agoric-cli/src/main.js:400:5)

file:///workspace/contract/scripts/parseProposals.mjs:6
  throw Error(String.raw(template, ...args.map(val => String(val))));
        ^

Error: No swingset-core-eval found in proposal output: bundle-source --to /workspace/contract/bundles /workspace/contract/src/gameAssetContract.js game1

    at Fail (file:///workspace/contract/scripts/parseProposals.mjs:6:9)
    at parseProposalParts (file:///workspace/contract/scripts/parseProposals.mjs:24:23)
    at main (file:///workspace/contract/scripts/parseProposals.mjs:36:17)
    at file:///workspace/contract/scripts/parseProposals.mjs:41:1
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)

Node.js v18.19.0
./scripts/build-proposal.sh
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
agoric: run: running /workspace/contract/scripts/build-game1-start.js
start-game1-proposal.js module evaluating
SES Lockdown using options from environment variables "LOCKDOWN_OVERRIDE_TAMING"
Removing intrinsics.Symbol.dispose
failed to delete intrinsics.Symbol.dispose (TypeError#1)
TypeError#1: Cannot delete property 'dispose' of function Symbol() { [native code] }

(TypeError#1)
agoric: (Error#1)
Error#1: bundle-source failed with status 255
  at makeError (file:///usr/src/agoric-sdk/node_modules/ses/src/error/assert.js:243:17)
  at fail (file:///usr/src/agoric-sdk/node_modules/ses/src/error/assert.js:357:20)
  at Fail (file:///usr/src/agoric-sdk/node_modules/ses/src/error/assert.js:366:39)
  at createBundlesFromAbsolute (file:///workspace/node_modules/@agoric/internal/src/node/createBundles.js:41:11)
  at createBundles (file:///workspace/node_modules/@agoric/internal/src/node/createBundles.js:50:10)
  at getBundle (file:///workspace/node_modules/@agoric/deploy-script-support/src/writeCoreProposal.js:60:13)
  at install (file:///workspace/node_modules/@agoric/deploy-script-support/src/writeCoreProposal.js:67:22)
  at game1ProposalBuilder (file:///workspace/contract/scripts/build-game1-start.js:19:11)
  at writeCoreProposal (file:///workspace/node_modules/@agoric/deploy-script-support/src/writeCoreProposal.js:90:14)
  at default (file:///workspace/contract/scripts/build-game1-start.js:33:9)
  at async file:///usr/src/agoric-sdk/packages/agoric-cli/src/scripts.js:188:7
  at async Command.parseAsync (/usr/src/agoric-sdk/packages/agoric-cli/node_modules/commander/lib/command.js:935:5)
  at async main (file:///usr/src/agoric-sdk/packages/agoric-cli/src/main.js:400:5)

file:///workspace/contract/scripts/parseProposals.mjs:6
  throw Error(String.raw(template, ...args.map(val => String(val))));
        ^

Error: No swingset-core-eval found in proposal output: bundle-source --to /workspace/contract/bundles /workspace/contract/src/gameAssetContract.js game1

    at Fail (file:///workspace/contract/scripts/parseProposals.mjs:6:9)
    at parseProposalParts (file:///workspace/contract/scripts/parseProposals.mjs:24:23)
    at main (file:///workspace/contract/scripts/parseProposals.mjs:36:17)
    at file:///workspace/contract/scripts/parseProposals.mjs:41:1
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)

Node.js v18.19.0
./scripts/install-bundles.sh
+ cd /workspace/contract
+ '[' -s bundles/bundle-list ']'
+ exit 1
make: *** [Makefile:110: install-bundles] Error 1
make: Leaving directory '/workspace/contract'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@dckc
Copy link
Member

dckc commented Jan 11, 2024

I just attempted to reproduce the problem without luck. Recording:

Under what circumstances does running the yarn start:contract command return an error? Do you have a series of steps to reproduce the problem?

@dckc dckc changed the title Running the yarn start:contract command returns an error yarn start:contract fails: TypeError#1: Cannot delete property 'dispose' of function Symbol Jan 11, 2024
@gacogo
Copy link

gacogo commented Jan 21, 2024

I've encountered the same error as described in this issue on both Ubuntu and macOS Sonoma. While the root cause is unclear, I found that using NodeJS 18.12.1 worked on both platforms. Here's a detailed workaround that I successfully implemented:

Step 1: Update the Dockerfile

Create a new Dockerfile with the following contents to set up the environment with the specific Node.js version; 18.12.1 in our case:

#start from base image
FROM ghcr.io/agoric/agoric-3-proposals:main

#install curl and other nodejs dependencies
RUN apt-get update && apt-get install -y curl gnupg build-essential

#install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

#install nodejs 18.12.1 and set it as default
RUN /bin/bash -c "source  ~/.nvm/nvm.sh && nvm install 18.12.1 && nvm alias default 18.12.1"

ENV PATH="/root/.nvm/versions/node/v18.12.1/bin:${PATH}"

#remove the old js binaries
RUN rm -rf /usr/local/bin/nodejs /usr/local/bin/node

#create symlink to the new nodejs
RUN ln -s /root/.nvm/versions/node/v18.12.1/bin/node /usr/local/bin/node
RUN ln -s /root/.nvm/versions/node/v18.12.1/bin/node /usr/local/bin/nodejs

#verify nodejs version
RUN node -v && nodejs -v

Step 2: Modify the docker-compose.yml

Update the docker-compose.yml file to use the new Dockerfile. This ensures that the environment is set up correctly when building the Docker container:


services:
  agd:
    build:
      context: .
      dockerfile: Dockerfile
    # image publication is WIP
    # cf. https://github.com/Agoric/agoric-3-proposals/issues/6
    #image: ghcr.io/agoric/agoric-3-proposals:main
    platform: linux/amd64
    ports:
      - 26656:26656
      - 26657:26657
      - 1317:1317
    environment:
      DEST: 1
      DEBUG: "SwingSet:ls,SwingSet:vat"
    volumes:
      - .:/workspace
    entrypoint: /workspace/contract/scripts/run-chain.sh

Step 3. Use the modified image for your container. Example docker compose up -d

Not elegant, but it resolves the issue. After applying these changes, running yarn start:contract should work without any problems.

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 a pull request may close this issue.

3 participants