click-to-component
click-to-component copied to clipboard
Add require exports
Describe the bug
when require.resolve('click-to-react-component'), an error was thrown:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in xxxxx//ode_modules/click-to-react-component/package.json
To Reproduce Steps to reproduce the behavior:
- npm i click-to-react-component
- See error
Expected behavior No error.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
exports.require need to be added in package.json
i got the same issue
i got the same issue when using ant-design-pro
i got the same issue when using ant-design-pro
You can revert the dependencies to the previously stable version (e.g., 1.0.8) as a temporary fix to start the project
i got the same issue when using ant-design-pro
i got the same issue when using ant-design-pro
temporarily add require
编译一直报错 过不去 应该怎么解决啊
same issue here
I don't think this is an error:
-
in webpack project, it can build successfully, showing no issues with the recommended usage of this package.
-
only having
exports.importmeans this package strictly allowsNative ESMimports only, and the following code runs correctly:// test.js import * as mod from 'click-to-react-component' const run = async () => { const mod2 = await import('click-to-react-component') console.log('mod: ', mod) // mod: [Module: null prototype] { ClickToComponent: [Function (anonymous)] } console.log('mod2: ', mod2) // mod2: [Module: null prototype] { ClickToComponent: [Function (anonymous)] } } run()
i got the same issue, how to fix?
i got the same issue, how to fix?
add resolutions to package.json
// package.json
"resolutions": {
"click-to-react-component":"1.1.0"
}
same issue
添加 "click-to-react-component":"1.0.8" 就可以解决了
fix with below code add in package.json
"resolutions": {
"click-to-react-component": "1.0.8",
},
Same issue, any progress?
How to fix this problem? Has anyone fixed this problem?
Same issue, any progress?
I want to know too!