reach-sh / reach-lang

Reach: The Safest and Smartest DApp Programming Language
https://www.reach.sh
Apache License 2.0
581 stars 167 forks source link

Reach run gives error on latest version #1563

Closed FrancescoMasaia closed 1 year ago

FrancescoMasaia commented 1 year ago

Describe the error

Reach Latest runner gives me error on execution

To Reproduce

Please include the program(s) that produce the unexpected behavior from Reach. If the error is in the compiler or during verification, you just need to include the .rsh file. If it is while the program is running, you should also include the .mjs file. It is easiest to link the file after posting them on gist.github.com, but if you don't want to share them publicly, please contact Jay McCarthy on our Discord server --- https://discord.gg/AZsgcXu --- and get them to him privately or he can help you reduce the code.

I was trying to use the overview example to start learning about Reach. But when i send the reach run command it gives me the current error:

[+] Building 0.4s (7/7) FINISHED                                                                                                                                                                                                                                                   
 => [internal] load .dockerignore                                                                                                                                                                                                                                             0.0s
 => => transferring context: 75B                                                                                                                                                                                                                                              0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                          0.0s
 => => transferring dockerfile: 329B                                                                                                                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/reachsh/runner:0.1.13                                                                                                                                                                                                              0.4s
 => [1/2] FROM docker.io/reachsh/runner:latest@sha256:38d376ad687502bb785b14a3291f96cef53f3771d1faf1ca3727a0f0f0fee80e                                                                                                                                                        0.0s
 => [internal] load build context                                                                                                                                                                                                                                             0.0s
 => => transferring context: 975B                                                                                                                                                                                                                                             0.0s
 => CACHED [2/2] COPY . /app                                                                                                                                                                                                                                                  0.0s
 => exporting to image                                                                                                                                                                                                                                                        0.0s
 => => exporting layers                                                                                                                                                                                                                                                       0.0s
 => => writing image sha256:afac566a2c1c308d5469c15c5c0f04f5f0e587eb63506d58e9cbe33a80a2df13                                                                                                                                                                                  0.0s
 => => naming to docker.io/reachsh/reach-app-tutorial-1:0.1.13                                                                                                                                                                                                                0.0s
Creating 2023-03-01t13-29-37z-qdiu_reach-app-tutorial-1_run ... done

> index
> node --experimental-modules --unhandled-rejections=strict index.mjs

file:///app/index.mjs:1
import { loadStdlib } from '@reach-sh/stdlib';
         ^^^^^^^^^^
SyntaxError: Named export 'loadStdlib' not found. The requested module '@reach-sh/stdlib' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@reach-sh/stdlib';
const { loadStdlib } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:127:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)
ERROR: 1

I was trying to test this program inside the Algo network Expected behavior

Please describe what you expected or hoped would happen. It's very strange that my computer gives error, I saw that the execution is done inside a docker container that i think have node and npm installed by default not using my machine version.

Extra information

What version of Reach are you using? You can run reach version or reach hashes to find out. Reach version is 0.1.13