-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React import problem, 'Module not found: Can't resolve' while import package wechaty #2305
Comments
Hi @pinoudliu , It's great to know that you want to integrate For your question, I do apologize for the missing I do this is because according to the spec of the NPM package.json, there has no I have searched the I'm not very familiar with the web build tools, as far as I know, is that the current version of the So could you please help me to provide some more articles to introduce about the
I'd like to fix it for you after we have enough knowledge about it, and PR is welcome. Resources |
Hi, @pinoudliu. I'm Dosu, and I'm helping the wechaty team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, you encountered an issue when trying to import the "wechaty" package in a React project. The error message "Module not found: Can't resolve" was reported. You suspected that the problem was due to a missing 'module' field in the package.json of 'wechaty'. The maintainer, huan, acknowledged the missing 'module' field and explained that it has been intentionally removed from the Wechaty ecosystem NPM modules. They asked for more information on how the web build tools work and suggested using the 'browser' entry point to support web build tools. If this issue is still relevant to the latest version of the wechaty repository, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the wechaty community. Let us know if you have any further questions or concerns. |
Then when I try to integrate "wechaty" with react, it failed to compile and report errors: Module not found: Can't resolve'
// Code in App.js
import { WechatyBuilder, ScanStatus, log} from "wechaty"
When I run npm start/yarn start, the error message appears
Failed to compile.
I guess it may be because there is no 'module' field in the package.json of 'wechaty', so I add that field.
`"module": "./dist/esm/src/mods/mod.js",
The problem do disappeared. But it still cannot resolve sub modules.
Even worse is that 'wechaty' has many dependence packages, and all the dependence packages have the same problem.
For more detail description, please check at StackOverflow:
The text was updated successfully, but these errors were encountered: