Skip to content
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

fix: rename template/extras/pnpm/.npmrc to _npmrc (remove "." prefix) to fix eslint installation error #2092

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

mmstroik
Copy link
Contributor

✅ Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

After the PR #2090 was merged to fix a VSCode ESLint Plugin issue with pnpm@10, the pnpm/.npmrc file that it PR added (which it references in cli/src/installers/eslint.ts) isn't getting included in the package, likely because npm packaging typically doesn't include dotfiles unless explicitly specified in the package.json "files" array.

This is causing the pnpn create t3-app@latest installation to abort during the eslint boilerplating because that .npmrc file can't be found:

...
✔ Successfully setup boilerplate for envVariables
⠋ Boilerplating eslint...Aborting installation...
Boilerplating eslint...Aborting installation...
Error: ENOENT: no such file or directory, lstat '.../node_modules/create-t3-app/template/extras/pnpm/.npmrc'

This can be confirmed by the following command:

$ npm view create-t3-app dist.tarball | xargs curl -s -o package.tgz && tar -xzf package.tgz && ls -la package/template/extras/pnpm/ 2>/dev/null || echo "File not found in published package"
File not found in published package

Fix: explicitly add the template/extras/pnpm/.npmrc file to the cli/package.json "files" array to ensure it gets included in the package

💯

Copy link

changeset-bot bot commented Mar 30, 2025

🦋 Changeset detected

Latest commit: 0c2940d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-t3-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 31, 2025 3:09pm

@DanTiw
Copy link

DanTiw commented Mar 30, 2025

Can confrim I am facing the same issue while using pnpm
image

@hengrv
Copy link
Contributor

hengrv commented Mar 30, 2025

Pulled this and looks good to me - can confirm changes work correctly ❤️ fixes #2093

@MaKTaiL
Copy link
Contributor

MaKTaiL commented Mar 31, 2025

I was responsible for PR #2090. Locally it was working fine and I had no idea why the published version was having this problem. Thanks for figuring out the issue! ❤️

I would personally rename the .npmrc file in extras folder to npmrc or _npmrc and make the necesssary changes in the eslint.ts file instead of explicitly specifying it in the package.json.

@JagTheFriend
Copy link

When will this be merged?, currently facing the same issue!

@mmstroik
Copy link
Contributor Author

I would personally rename the .npmrc file in extras folder to npmrc or _npmrc and make the necesssary changes in the eslint.ts file instead of explicitly specifying it in the package.json.

ya good call -- just made that change to the PR

@mmstroik mmstroik changed the title fix: explicitly add template/extras/pnpm/.npmrc file to package.json to fix eslint error fix: rename template/extras/pnpm/.npmrc to npmrc (without the ".") to fix eslint error Mar 31, 2025
@mmstroik
Copy link
Contributor Author

K lol actually just noticed that other templated files like gitignore use underscore prefixes so changed it to that to follow convention

@mmstroik mmstroik changed the title fix: rename template/extras/pnpm/.npmrc to npmrc (without the ".") to fix eslint error fix: rename template/extras/pnpm/.npmrc to _npmrc (remove "." prefix) to fix eslint installation error Mar 31, 2025
@juliusmarminge juliusmarminge merged commit 0fdbafc into t3-oss:main Apr 1, 2025
272 checks passed
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.

6 participants