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

nodenext #93

Merged
merged 1 commit into from
Jan 29, 2025
Merged

nodenext #93

merged 1 commit into from
Jan 29, 2025

Conversation

dfstio
Copy link
Contributor

@dfstio dfstio commented Dec 21, 2024

Updated the module resolution to NodeNext

@@ -3,13 +3,13 @@
"compilerOptions": {
"outDir": "./build",
"rootDir": ".",
"baseUrl": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woah just realized that this line makes it work! why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS docs about this confuse me even more https://www.typescriptlang.org/tsconfig/#baseUrl

This feature was designed for use in conjunction with AMD module loaders in the browser, and is not recommended in any other context. As of TypeScript 4.1, baseUrl is no longer required to be set when using paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woah just realized that this line makes it work! why?

In my experience, the problem arises because TypeScript builds o1js type paths incorrectly; usually, the path leads above the repository folder, and TypeScript assumes that this type will not be available for this reason. Adding the dot as the baseUrl helps to resolve this issue in my repositories, so I have tried this on your repo as well.

The proper way is probably to adjust some path configuration in o1js instead of setting the baseUrl, but I'm not sure that's feasible given the complicated build scripts in use. Regardless, it finally worked, and it took me a year to find a working configuration. It's funny that it is just one dot))

Copy link
Member

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mitschabaude mitschabaude merged commit 3243274 into zksecurity:main Jan 29, 2025
1 check passed
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 this pull request may close these issues.

2 participants