Closed AllenFang closed 5 years ago
@AllenFang Thanks for reporting this.
I assumed that bundler that uses module
can deal esnext, but it's not true in your case.
So, CRA is fine, but not for next.js. Let me take some time to investigate it and deal with it.
Meanwhile, you can import dist
directly. Hope it helps for your use case.
import { createGlobalState } from 'react-hooks-global-state/dist';
you can import dist directly. Hope it helps for your use case.
oh, I forget I can do it 😄
Anyway, thanks your reply, you can decide to close this issue anytime.
See also: https://github.com/zeit/next.js/issues/706
I'd like to keep "module", unless we find a better way.
Hello @dai-shi, firstly, thanks for this awesome package, I just encounter a wired issue when I adopt this package. After deeply digging, i felt the root cause is about the "module field in package.json" probably.
The issue is when I running my application,I saw this error message:
My application stack is
next.js@7.0.0
yarn@1.12.3
node@9.10.0
The wired thing is when I use npm will fix this issue. So I try to clone this code and use npm link to do some local testing, I found if I remove
module
field in package.json or change it todist/index.js
will fix this issue certainly.Seems like
module
is still proposal and not sure if there's any different when developer use yarn or npm install the package.Could we fix this issue just remove the
module
field or change it todist/index.js
Thanks