nextjs15 with .babelrc report $ is not a function
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/wotermelon/nextjs15-babelrc
To Reproduce
- create-nextjs-app
- use .babelrc
{
"presets": [
[
"next/babel",
{
"preset-env": {
"useBuiltIns": "usage",
"corejs": 3
}
}
]
],
"plugins": []
}
3.run dev command and see the console
Current vs. Expected behavior
this console report error like this:
es.global-this.js:8 Uncaught TypeError: $ is not a function
at (app-pages-browser)/n…736510805707:5971:1)
at options.factory (webpack.js?v=1736510805707:712:31)
at webpack_require (webpack.js?v=1736510805707:37:33)
at fn (webpack.js?v=1736510805707:369:21)
at (app-pages-browser)/n…736510805707:7159:1)
at options.factory (webpack.js?v=1736510805707:712:31)
at webpack_require (webpack.js?v=1736510805707:37:33)
at fn (webpack.js?v=1736510805707:369:21)
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 18.18.2
npm: 9.8.1
Yarn: 1.22.22
pnpm: 8.6.1
Relevant Packages:
next: 15.1.4 // Latest available version is detected (15.1.4).
eslint-config-next: 15.1.4
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked reproduction repository with Next.js 15.1.4 and its shown .babelrc configuration, then run the next dev command to confirm the error. Trace how this Babel configuration is processed during development and compare the generated module behavior with the expected startup behavior. Done means the reproduction runs without the "$ is not a function" error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100