Closed Andrew-Colman closed 3 years ago
I made a copy of node_modules/@geist-ui/react/esm/input/use-input.js
to: node_modules/@geist-ui/react/esm/use-input.js
(and remapped '../utils/use-current-state';
to './utils/use-current-state';
)
and it removed the compilation error on my project (hope this can help track the source of the issue )
This is a module path error, which has been fixed in the canary version.(yarn add @geist-ui/react@canary
)
which has been fixed in the canary version
still getting this error with canary: (2.2.0-rc.8)
small example: https://github.com/Andrew-Colman/geist-ui-react/tree/tree-shaking-use-input-test
git clone https://github.com/Andrew-Colman/geist-ui-react.git
&& cd geist-ui-react
&& git checkout tree-shaking-use-input-test
&& cd tree-shaking-nextjs-canary && yarn && yarn dev
others may face this problem for now.
fixed in v2.2.0
. If a similar issue occurs again, please reopen.
Bug report 🐞
Tree shaking error when using use input hook
easily reproducible with Tree shaking with Next.js example
any component using :
import { useInput } from "@geist-ui/react";
const { state, reset, bindings } = useInput();
will break the full project
Version & Environment
geist-ui/react
: 2.1.5Expected Behaviour
Should compile without errors
Actual results (or Errors)
I got an error:
Failed to compile: