4

how are you?

I have a project with React 17 and babel-loader and i'm trying to change it to esbuild-loader. For this i installed "esbuild-loader": "2.19.0" and changed my webpack loader config to this:

{
  test: /\.js$/,
  loader: 'esbuild-loader',
  options: {
    loader: 'jsx', // Remove this if you're not using JSX
    target: 'es2015' // Syntax to compile to (see options below for possible values)
  }
}

However, when i try to build my app, it now throws the following error:

WARNING in ./node_modules/react-select/node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js 107:25-52 export 'useInsertionEffect' (imported as 'React') was not found in 'react' (possible exports: Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version)

According to my research, this seems to be a problem fixed with the most recent versions of @emotion/react, however, i tried to install @emotion/react@11.10.0 and the problem persists.

Have anyone experienced this? If so, how did you solved it?

Thanks in advance!

Rohr Facu
  • 607
  • 1
  • 12
  • 29

0 Answers0