Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

The published package is missing built artifacts (lib/, es6/, browser/), causing module resolution failures:

Error: Cannot find module '.../comment-parser/lib/index.cjs'

These directories are gitignored and were not being built before npm publish unless npm version was run first.

Changes

  • Add prepare script to run build before npm pack and npm publish
  • Add prepublishOnly script as additional safeguard before publish
  • Add *.tgz to .gitignore to exclude build artifacts

The prepare hook ensures built files exist in the tarball regardless of publish workflow.

Original prompt

This section details on the original issue you should resolve

<issue_title>broken release</issue_title>
<issue_description>```
Error: Cannot find module '/Users/gajus/Developer/gajus/slonik/node_modules/.pnpm/eslint-plugin-regexp@2.10.0_eslint@9.39.2_jiti@2.6.1_/node_modules/comment-parser/lib/index.cjs'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1457:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1446:9)
at resolveExports (node:internal/modules/cjs/loader:678:14)


## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@syavorsky</author><body>
@gajus can you hint me how I can reproduce this issue?</body></comment_new>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 22:58
Co-authored-by: syavorsky <455779+syavorsky@users.noreply.github.com>
…blishing

Co-authored-by: syavorsky <455779+syavorsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix module not found error in release Add prepare script to ensure build artifacts are included in published package Jan 16, 2026
Copilot AI requested a review from syavorsky January 16, 2026 23:06
@syavorsky syavorsky marked this pull request as ready for review January 16, 2026 23:09
@syavorsky syavorsky merged commit b1b19d6 into master Jan 16, 2026
6 checks passed
@syavorsky syavorsky deleted the copilot/fix-broken-release-issue branch January 16, 2026 23:11
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.

broken release

2 participants