ukstv / o1js-nodenext-repro

Demonstrates incompatibility between o1js and NodeNext

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

O1JS is not quite compatible with NodeNext module resolution

src/index.ts contains a simple program that gets exported:

import { Bool, Field, ZkProgram } from "o1js";

export const HelloProgram = ZkProgram({
    name: "hello-program",
    publicInput: Field,
    publicOutput: Bool,
    methods: {
        addition: {
            privateInputs: [Field, Field],
            method(sum, a, b) {
                return a.add(b).equals(sum);
            },
        },
    },
});

Nothing criminal here, but it can not be compiled by TS compiler while using NodeNext module resolution algorithm.

If you go to tsconfig.json and change "moduleResolution": "NodeNext", to "moduleResolution": "Node", it works okay though.

About

Demonstrates incompatibility between o1js and NodeNext


Languages

Language:TypeScript 100.0%