-
-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Reproduction link or steps
Reproduction Link: https://github.com/methompson/tsdown_issue_example
- Clone the repo
- Install dependencies with
npm ci - Run
npm run buildto test the build process and observe a successful build - Install the latest version with
npm i -D tsdown@latest - Run
npm run buildto observe the failing build process
When using v0.17, this application will build fine.
When using v0.18+, the application no longer builds.
I am running all of this using Node v22.
What is expected?
I expect the build process to build and complete as normal, just like with tsdown v0.17.
What is actually happening?
An error is displayed:
ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
ERROR TypeError: Cannot read properties of undefined (reading 'exports')
at require (node:internal/modules/esm/translators:152:33)
at Object.getPkg (/Users/work/Desktop/work/issue_example/node_modules/jsonc-eslint-parser/lib/parser/visitor-keys.js:40:28)
at loadNewest (/Users/work/Desktop/work/issue_example/node_modules/jsonc-eslint-parser/lib/parser/modules/require-utils.js:73:26)
at getVisitorKeys (/Users/work/Desktop/work/issue_example/node_modules/jsonc-eslint-parser/lib/parser/visitor-keys.js:21:51)
at Object.<anonymous> (/Users/work/Desktop/work/issue_example/node_modules/jsonc-eslint-parser/lib/index.js:40:57)
at loadCJSModule (node:internal/modules/esm/translators:166:3)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7)
at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async nativeImport (file:///Users/work/Desktop/work/issue_example/node_modules/tsdown/dist/options-DfwuH01N.mjs:489:14)
I've narrowed the issue down to the jsonc-eslint-parser package installed by the @intlify/unplugin-vue-i18n package. This package, in its current incarnation, worked fine with v0.17, but now fails for versions 0.18+.
I understand that the jsonc-eslint-parser project uses CJS, but that hadn't been a problem with vite or versions of tsdown earlier than 0.18.
Any additional comments?
I installed this plugin this past November, I ran into this bug when attempting to upgrade from tsdown v0.17 to v0.20 due to a deprecation warning. Our current library seems to work for now, but I'd rather not be hamstrung due to a single CJS repository...
I'd love to help resolve this issue as best as I can.