Reproduction link or steps
https://stackblitz.com/edit/ney29w29?file=index.ts
Run:
pnpm install
pnpm build
node dist/index.cjs
What is expected?
The program runs successfully and can find jsonc-parser parse function.
This was supported in vite7 and got broken with vite8.
eslint-plugin-oxlint@v1.55.0 with vite7: https://npmx.dev/package-code/eslint-plugin-oxlint/v/1.55.0/dist%2Fbuild-from-oxlint-config%2Futilities.cjs
eslint-plugin-xolint@v1.56.0 with vite8: https://npmx.dev/package-code/eslint-plugin-oxlint/v/1.56.0/dist%2Fbuild-from-oxlint-config%2Futilities.cjs
I expect that the 2 following code blocks behave the same:
// fails to run build cjs
import Parser from 'jsonc-parser';
Parser.parse();
// runs build cjs
import {parse} from 'jsonc-parser';
parse();
What is actually happening?
❯ node dist/index.cjs
TypeError: can't access property "parse", jsonc_parser.default is undefined
at <anonymous> (/home/projects/ney29w29/dist/index.cjs:26:1)
at Module.prototype._compile (node:internal/modules/cjs/loader:160:18351)
at Module._extensions..js (node:internal/modules/cjs/loader:160:19092)
at Module.prototype.load (node:internal/modules/cjs/loader:160:16623)
at Module._load (node:internal/modules/cjs/loader:160:14286)
at traceSync (node:diagnostics_channel:26:3678)
at wrapModuleLoad (node:internal/modules/cjs/loader:160:3949)
at executeUserEntryPoint (node:internal/modules/run_main:179:2180)
at run_main_module (node:internal/main/run_main_module:155:484)
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 22.22.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@rolldown/browser: 1.0.0-rc.10
Any additional comments?
Coming from oxc-project/eslint-plugin-oxlint#672
Reproduction link or steps
https://stackblitz.com/edit/ney29w29?file=index.ts
Run:
What is expected?
The program runs successfully and can find
jsonc-parserparse function.This was supported in vite7 and got broken with vite8.
eslint-plugin-oxlint@v1.55.0with vite7: https://npmx.dev/package-code/eslint-plugin-oxlint/v/1.55.0/dist%2Fbuild-from-oxlint-config%2Futilities.cjseslint-plugin-xolint@v1.56.0with vite8: https://npmx.dev/package-code/eslint-plugin-oxlint/v/1.56.0/dist%2Fbuild-from-oxlint-config%2Futilities.cjsI expect that the 2 following code blocks behave the same:
What is actually happening?
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 22.22.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.2 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: @rolldown/browser: 1.0.0-rc.10Any additional comments?
Coming from oxc-project/eslint-plugin-oxlint#672