You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error output from webpack when attempting to build a simple component that uses emotion:
WARNING in ./~/emotion/src/react/index.js
81:11-12 "export 'createElement' (imported as 'h') was not found in 'react'
ERROR in ./~/emotion/src/utils.js
Module parse failed: /mnt/c/Users/Granmoe/projects/boilerplates/react-redux-saga-boilerplate/node_modules/emotion/src/utils.js Unexpected token (3:5)
You may need an appropriate loader to handle this file type.
| // @flow weak
| export function omit(
| obj: { [string]: any },
| testFn: (key: string, obj: any) => boolean
| ) {
@ ./~/emotion/src/react/index.js 3:0-52
@ ./~/emotion/lib/react/index.js
@ ./~/emotion/react/index.js
@ ./src/components/app.jsx
@ ./src/main.jsx
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./src/main.jsx
ERROR in ./~/emotion/src/index.js
Module parse failed: /mnt/c/Users/Granmoe/projects/boilerplates/react-redux-saga-boilerplate/node_modules/emotion/src/index.js Unexpected token (12:19)
You may need an appropriate loader to handle this file type.
| sheet.inject()
|
| export let inserted: { [string | number]: boolean | void } = {}
|
| export function flush() {
@ ./~/emotion/src/react/index.js 2:0-30 6:0-14:17
@ ./~/emotion/lib/react/index.js
@ ./~/emotion/react/index.js
@ ./src/components/app.jsx
@ ./src/main.jsx
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./src/main.jsx
I read something in another issue about problems being caused by having your webpack entry file in a source dir named "src," which mine is, as you can see below.
For anyone curious why this happens: it happens because webpack tries to look for the react module so it goes up the file tree until it finds a module directory which in this case is src then node_modules so it looks in src and finds a react folder and uses the index.js file from that folder as the react module.
We're planning to switch to a monorepo with a seperate package for the react version soon which will completely fix this problem.
I'm getting the following error output from webpack when attempting to build a simple component that uses emotion:
I read something in another issue about problems being caused by having your webpack entry file in a source dir named "src," which mine is, as you can see below.
I do have the emotion babel plugin in my babelrc:
And here's my webpack config:
Here's one of my components:
emotion
version: 7.0.13react
version: 15.6.1Reproduction:
Run
./node_modules/webpack-dev-server/bin/webpack-dev-server.js
with BABEL_ENV and NODE_ENV === "development"
The text was updated successfully, but these errors were encountered: