-
Notifications
You must be signed in to change notification settings - Fork 9
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 dev warnings #342
Merged
Merged
Fix dev warnings #342
+6
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`pnpm dev` shows this waning: ``` warn - Your `content` configuration includes a pattern which looks like it's accidentally matching all of `node_modules` and can cause serious performance issues. warn - Pattern: `./packages/**/*.ts` warn - See our documentation for recommendations: warn - https://tailwindcss.com/docs/content-configuration#pattern-recommendations ```
This commit adds `public-hoist-pattern[] = require-in-the-middle` to .npmrc to resolve the build error: ``` ⚠ ./node_modules/.pnpm/@opentelemetry[email protected]_@[email protected]/node_modules/@opentelemetry/instrumentation/build/esm/platform/node Package require-in-the-middle can't be external The request require-in-the-middle matches serverExternalPackages (or the default list). The request could not be resolved by Node.js from the project directory. Packages that should be external need to be installed in the project directory, so they can be resolved from the output files. Try to install it into the project directory by running npm install require-in-the-middle from the project directory. ``` This error occurs because Next.js (Turbopack) fails to resolve `require-in-the-middle`, a dependency of `@opentelemetry/instrumentation`, due to pnpm's strict `node_modules` structure. `public-hoist-pattern` is a temporary workaround to hoist `require-in-the-middle` to the root `node_modules`, making it accessible to Turbopack. This is a temporary fix for [vercel/next.js#68805](vercel/next.js#68805). We should monitor the issue for a permanent Turbopack fix and remove this workaround when resolved.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This commit updates `prepare-font.js` to use `@next/env` for loading environment variables. Bun automatically loads `.env` and `.env.local`, but Node.js (and thus pnpm scripts) requires explicit configuration. By switching to `@next/env`, we leverage Next.js's built-in environment variable loading mechanism, which correctly handles `.env`, `.env.local`, and environment-specific files. This ensures consistent environment variable loading across different environments and package managers. This change resolves an issue introduced when migrating from Bun to pnpm, where environment variables were not being correctly loaded in `prepare-font.js`.
satococoa
force-pushed
the
fix-dev-warnings
branch
from
January 30, 2025 02:40
90c413f
to
44648b1
Compare
shige
approved these changes
Jan 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
toyamarinyon
approved these changes
Jan 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request fixes these problems in development.
tailwind warning
require-in-the-middle can't be external
This error occurs because Next.js (Turbopack) fails to resolve
require-in-the-middle
, a dependency of@opentelemetry/instrumentation
, due to pnpm's strictnode_modules
structure.public-hoist-pattern
is a temporary workaround to hoistrequire-in-the-middle
to the rootnode_modules
, making it accessible to Turbopack.This is a temporary fix for vercel/next.js#68805. We should monitor the issue for a permanent Turbopack fix and remove this workaround when resolved.
prepare-font.js is not download fonts even if
FORCE_DOWNLOAD_FONTS=1
Previously, Bun automatically loads
.env
and.env.local
, but Node.js (and thus pnpm scripts) requires explicit configuration.