-
Notifications
You must be signed in to change notification settings - Fork 202
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
feat: add back cjs output #1964
Conversation
π PR was released in |
Smart way to import |
Thanks! This works for node projects but not for browser projects. I wish there was a way to make this work more generally but this feels right for this project. |
Hey guys so unfortunately I think this still doesn't work. Or it's also entirely possible I'm doing something wrong but, whenever I try to import something from Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/stevencummings/workspace/ternary/core-web-server/node_modules/ts-json-schema-generator/cjs/index.js from /Users/stevencummings/workspace/ternary/core-web-server/scripts/docs-gen/Oas3Generator.ts not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/stevencummings/workspace/ternary/core-web-server/node_modules/ts-json-schema-generator/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead). Sorry if this isn't the best place to discuss, lmk if I should open a new issue or what the best thing is to do. |
Hmm, we might need to rename the js files to cjs to fix this. |
Replaces #1956
Version
Published prerelease version:
v2.2.0-next.2
Changelog
π This release contains work from new contributors! π
Thanks for all your work!
β€οΈ Sampsa Kaskela (@SampsaKaskela)
β€οΈ Rama Krishna Ghanta (@ramaghanta)
β€οΈ Tim (@timothympace)
π Enhancement
export *
statements #1962 (@arthurfiorette)π Bug Fix
π© Dependency Updates
Authors: 6