You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing build errors related to .ts files that contain #!/usr/bin/env node, which tsup tries to chmod +x in order to ensure they are executable:
⋮
ESM dist/integrations/webpack-plugin.mjs 2.93 KB
ESM dist/imperativeAPI/useIntl.mjs 428.00 B
ESM dist/compiledLocales/es.mjs 4.58 KB
ESM dist/compiledLocales/sr.mjs 7.41 KB
ESM dist/types/index.mjs 156.00 B
ESM dist/compiledLocales/et.mjs 4.54 KB
ESM ⚡️ Build success in 140ms
DTS Build start
Error: ENOENT: no such file or directory, chmod '/Users/kyank/Developer/unified-home/packages/i18n-react-intl/dist/scripts/extract.d.mts'
Error: error occured in dts build
at Worker.<anonymous> (/Users/kyank/Developer/unified-home/node_modules/tsup/dist/index.js:2294:26)
at Worker.emit (node:events:513:28)
at MessagePort.<anonymous> (node:internal/worker:243:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:737:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
If I re-run the build without deleting the dist directory first, the error does not re-occur. If I remove the scripts/extract.ts entry module from my project, the same error occurs with a different script:
⋮
ESM dist/integrations/webpack-plugin.mjs 2.93 KB
ESM dist/compiledLocales/lv.mjs 6.08 KB
ESM dist/imperativeAPI/formatDate.mjs 166.00 B
ESM dist/compiledLocales/et.mjs 4.54 KB
ESM dist/compiledLocales/tl.mjs 4.53 KB
ESM dist/integrations/webpack.mjs 328.00 B
ESM ⚡️ Build success in 172ms
DTS Build start
Error: ENOENT: no such file or directory, chmod '/Users/kyank/Developer/unified-home/packages/i18n-react-intl/dist/scripts/smartlingPush.d.mts'
Error: error occured in dts build
at Worker.<anonymous> (/Users/kyank/Developer/unified-home/node_modules/tsup/dist/index.js:2294:26)
at Worker.emit (node:events:513:28)
at MessagePort.<anonymous> (node:internal/worker:243:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:737:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I've tried and failed to reproduce this in a toy project, where I guess the generation of .d.(m)ts files runs much more quickly, and therefore all of those files are generated before tsup tries to chmod those with shebangs at the top.
Unless I'm mistaken, the .d.(m)ts files for shebang scripts don't actually need to be chmod +x; only the actual .(m)js files need to be made executable. Could this be fixed by excluding the type definition files from the shebang plug-in?
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
I've traced this to the use of https://github.com/egoist/rollup-plugin-hashbang in tsup's invocation of rollup to build dts files. Removing it from that task's rollup configuration seems to resolve this issue with no apparent side-effects. I will open a PR for further discussion of this possible solution.
I'm seeing build errors related to .ts files that contain
#!/usr/bin/env node
, which tsup tries to chmod +x in order to ensure they are executable:If I re-run the build without deleting the dist directory first, the error does not re-occur. If I remove the
scripts/extract.ts
entry module from my project, the same error occurs with a different script:I've tried and failed to reproduce this in a toy project, where I guess the generation of .d.(m)ts files runs much more quickly, and therefore all of those files are generated before tsup tries to chmod those with shebangs at the top.
Unless I'm mistaken, the .d.(m)ts files for shebang scripts don't actually need to be chmod +x; only the actual .(m)js files need to be made executable. Could this be fixed by excluding the type definition files from the shebang plug-in?
Upvote & Fund
The text was updated successfully, but these errors were encountered: