Unable to use with NextJS - `Identifier 'e' has already been declared`
- Dominant language
- TypeScript
- Stars
- 14.7k
- Forks
- 777
- PR merge metrics
- No merged PRs in 30d
Description
# Expected Behavior
Hoping to use Jimp on the with NextJS through client components
# Current Behavior
- Oddly everything works as intended when running dev server `next dev`
- But when building and running built files with `next build && next start`, Jimp causes the JS bundle to break.
# Failure Information (for bugs)
The page will load with a console error:
```
Uncaught SyntaxError: Identifier 'e' has already been declared (at 17278b49-0d4591d2014ecb83.js:1:185)
```
The referenced file and line lead to the following minified code:
```
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[783],{9072:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){let emojiRegex,e,e,e,e,e,e,e,e,e;__webpack_require__.d(__webpack_exports__,{cS:function(){return Jimp}});var ResizeStrategy,ResizeStrategy2,process=__webpack_require__(357)
...
```
The syntax error (red underline) begins happening at the `e,e,e,e,e,e,e,e,e`
Occasionally (if spamming refresh), I will also see the generic NextJS error page (`Application error: a client-side exception has occurred (see the browser console for more information).`) with console errors indicating:
```
23-fa6adf0081b597ab.js:1 ChunkLoadError: Loading chunk 783 failed.
...
Uncaught Error: Minified React error #423; visit https://react.dev/errors/423 for the full message or use the non-minified dev environment for
```
## Steps to Reproduce
Minimal repro repo: https://github.com/kwerdna19/next-jimp-test
Steps:
```
git clone https://github.com/kwerdna19/next-jimp-test.git
cd next-jimp-test
npm install
npm run build
npm run start
```
Then navigate to http://localhost:3000/
## Context
Node: v20.16
```
"jimp": "^1.6.0",
"next": "14.2.13",
```
Any ideas or help are appreciated.
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.