Trivial .babelrc breaks <Image> component
Link to the code that reproduces this issue
https://github.com/igorkofman/next-babel-repro
To Reproduce
- Creact a .babelrc with just the default contents
- npm run dev
Current vs. Expected behavior
igor@MacBook-Air-3 my-app % npm run dev
dev next dev
▲ Next.js 14.1.1-canary.10
- Local: http://localhost:3000
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled ✓ Ready in 1033ms Using external babel configuration from /Users/igor/src/my-app/.babelrc ⚠ It looks like there is a custom Babel configuration that can be removed. ⨯ ../../node_modules/process/browser.js TypeError: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "BooleanLiteral" Import trace for requested module: ../../node_modules/process/browser.js ./node_modules/next/dist/compiled/picomatch/index.js ./node_modules/next/dist/shared/lib/match-remote-pattern.js ./node_modules/next/dist/shared/lib/image-loader.js ./node_modules/next/dist/client/image-component.js ○ Compiling / ... ⨯ ../../node_modules/process/browser.js TypeError: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "BooleanLiteral" Import trace for requested module: ../../node_modules/process/browser.js ./node_modules/next/dist/compiled/picomatch/index.js ./node_modules/next/dist/shared/lib/match-remote-pattern.js ./node_modules/next/dist/shared/lib/image-loader.js ./node_modules/next/dist/client/image-component.js
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112
Binaries:
Node: 20.8.0
npm: 10.2.5
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 14.1.1-canary.10 // Latest available version is detected (14.1.1-canary.10).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.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
Adding trivial .babelrc with just nextjs presets breaks the <Image> component.
This works with nextjs 14.0.1 and breaks with 14.1.0
Same issue with Nextjs 14.1.0
I'm getting this issue as well when trying to use 14.1.0, does not happen with 14.0.4.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.