Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
The development mode no longer works with a library imported via Yalc | GoodFirstPicks

The development mode no longer works with a library imported via Yalc

vercel/next.js 20 comments 20d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

The issue involves module system interop problems when using yalc with Next.js 12.1.0.

AI Summary

The issue occurs when using yalc-linked packages with ESM exports in Next.js 12.1.0, causing module parsing errors. The problem relates to how Next.js handles symlinked packages in its webpack configuration. There's a reproduction available but the fix may require understanding both module systems and Next.js's build pipeline.

Issue Description

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 16.13.1
  npm: 8.5.3
  Yarn: 1.22.17
  pnpm: N/A
Relevant packages:
  next: 12.1.0
  react: 17.0.2
  react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Since I use version NextJS "12.1.0", when I launch my application in development mode, I have an error in the server console:

$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from C:\dev\dev\XXX\XXX-core\.env.local
info  - Loaded env from C:\dev\dev\XXX\XXX-core\.env
warn  - SWC minify release candidate enabled. https://nextjs.org/docs/messages/swc-minify-enabled
Prepare XXX build client side
Prepare XXX build server side
error - ./.yalc/@XXX/XXX-customers/dist/customers/XXX/index.js
Module parse failed: Cannot use 'import.meta' outside a module (219:16)
File was processed with these loaders:
 * ./node_modules/next/dist/compiled/@next/react-refresh-utils/loader.js
 * ./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
You may need an additional loader to handle the result of these loaders.
|                 // still a Refresh Boundary later.
|                 // @ts-ignore importMeta is replaced in the loader
>                 import.meta.webpackHot.accept();
|                 // This field is set when the previous version of this module was a
|                 // Refresh Boundary, letting us know we need to check for invalidation or

Note that before I was using version 12.0.4 and that I use yalc link to reference my custom library locally

Expected Behavior

my application launches correctly in development mode (

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • ESM/CJS module interop
  • yalc symlink handling
  • webpack config changes
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno