Closed puranjayjain closed 1 year ago
.mjs
is not supported. I have never seen@augnlar/core
served as .mjs
format
It happens with angular 13 @allenhwkim
Hi I have the same error:
Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/@angular/common/fesm2015/http.mjs not supported.
Instead change the require of node_modules/@angular/common/fesm2015/http.mjs to a dynamic import() which is available in all CommonJS modules.
at Object.
Still facing this issue
getting error: Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/@angular/common/fesm2015/http.mjs not supported. Instead change the require of node_modules/@angular/common/fesm2015/http.mjs to a dynamic import() which is available in all CommonJS modules. at Object. (:10:16) at requireFromString (/usr/local/lib/node_modules/ngentest/node_modules/require-from-string/index.js:28:4) at run (/usr/local/lib/node_modules/ngentest/index.js:159:21) at Object. (/usr/local/lib/node_modules/ngentest/index.js:228:3) { code: 'ERR_REQUIRE_ESM' }
Same here
This can indeed be fixed but would require a level of effort not possible by one person. If anyone here is willing to help me, we can fork it and do the following things:
@puranjayjain I can help with this. I have worked on similar things before.
@puranjayjain I can help with this. I have worked on similar things before.
hi, could you help me for this problem? Thanks
This can indeed be fixed but would require a level of effort not possible by one person. If anyone here is willing to help me, we can fork it and do the following things:
- Bring the dependencies to the latest version
- ts parser and other parsers need to be adjusted according to angular 13 and 14.
- Drop support for older angular version pre 11.
Hi, could you help me for this? Thanks
Hi, has anyone tried working on this issue? I am working on a project involving Angular unit tests and through some research came across this package. I would love to implement this into my development process but ran into the same issue as stated in the original issue in this thread. I made a fork of ngentest on another one of my accounts but I am new to Angular and I do not know how to solve the out of support issue on my own.
@puranjayjain @PankajMSharma @XiaotianWU-code @allenhwkim If any of you have made progress on adding Angular 13+ support for ngentest please let me know and I would love to help if at all possible. Thank you!
@andrewscheiner I currently am using 13 and will upgrade to 16. I haven't integrated anything in 15+ so far but you can look at jest as it's now natively supported by angular.
@puranjayjain Ok so you are using Angular 13 and are suggesting that I look into using jest for Angular unit testing? I will do some research into Jest then. Do you happen to know if jest has any methods/functions which might be similar to what ngentest accomplishes?
Unfortunately not. @andrewscheiner also I would say look into jest but it only works with angular 15+. Since you're starting out I'd highly recommend going with angular 16 as it is a massive update.
This is fixed by 1.5.0 release Remove Angular dependency by parsing code directly instead of using require-from-string #63
Please upgrade your command to 1.5.0, npm install ngentest@1.5.0 -D
I used the following command on a component and a guard file
I got the following response
I'm using the following versions
node: v16.13.1 yarn: 1.22.15