You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "GitToTheHub (via GitHub)" <gi...@apache.org> on 2024/12/30 21:35:36 UTC
[I] Bad error message if a module is not found [cordova-common]
GitToTheHub opened a new issue, #219:
URL: https://github.com/apache/cordova-common/issues/219
# Bug Report
I'm new in plugin development and tried to write a hook. I used as an example
https://github.com/AyogoHealth/cordova-plugin-app-scope/blob/main/src/prepare_hook.js
When I was executing the line: `const et = require('elementtree');` I got an error on the console:
```bash
TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('MODULE_NOT_FOUND')
at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
at /Users/manuelbeck/.nvm/versions/node/v22.9.0/lib/node_modules/cordova/bin/cordova:32:22
```
I was wondering about this error message and looked in `cordova:32:22`. The line which was throwing the error was:
`process.exitCode = err.code || 1;`
I understood, the console was complaining that `code` was a string instead of a number. When I did `console.log(err)` in the script, I saw the error message:
```bash
Error: Cannot find module 'elementtree'
Require stack:
- /Users/manuelbeck/Projekte/GitHub/cordova-plugin-local-notifications/src/prepare_hook.js
- /Users/manuelbeck/.nvm/versions/node/v22.9.0/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js
- /Users/manuelbeck/.nvm/versions/node/v22.9.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js
- /Users/manuelbeck/.nvm/versions/node/v22.9.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/plugman.js
- /Users/manuelbeck/.nvm/versions/node/v22.9.0/lib/node_modules/cordova/node_modules/cordova-lib/cordova-lib.js
...
```
This should be fixed.
### Command or Code
`cordova prepare android`
### Environment, Platform, Device
macOS 15.2
MacBook Pro 2019 13"
ZSH
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
Cordova CLI: 12.0.0 (cordova-lib@12.0.2)
cordova-Android: 13.0.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Bad error message if a module is not found [cordova-common]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on issue #219:
URL: https://github.com/apache/cordova-common/issues/219#issuecomment-2566528701
> Do you know, when this will be released?
Can't make any promises about release dates or timelines, since Apache Cordova is maintained by volunteers. It will depend on when someone has time and capacity to start the release process. Lately the focus has been on other things like the next major version for the iOS platform.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Bad error message if a module is not found [cordova-common]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on issue #219:
URL: https://github.com/apache/cordova-common/issues/219#issuecomment-2566279966
Hi, yes it looks that it is fixed by this pr. So I have to what for a new release of the cli. Do you know, when this will be released? Thanks and regards.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Bad error message if a module is not found [cordova-common]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on issue #219:
URL: https://github.com/apache/cordova-common/issues/219#issuecomment-2566015812
I believe this was fixed in cordova-cli in https://github.com/apache/cordova-cli/pull/640
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Bad error message if a module is not found [cordova-common]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub closed issue #219: Bad error message if a module is not found
URL: https://github.com/apache/cordova-common/issues/219
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Bad error message if a module is not found [cordova-common]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on issue #219:
URL: https://github.com/apache/cordova-common/issues/219#issuecomment-2566531317
Thank you, I understand and it is clear to me. Now I know this issue and know, there will be a fix in the future :)
Regards, Manuel
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org