I'm writing my first lines on Nestjs but when I create my first .ts file I got this error, I don't understand what this means.
I found the solution in other question the thing is that you have to change the follow configuration on VSC
Related
I'm seeing the mentioned error, with stack trace below
Error: Cannot find module 'src/auth/guards/jwt-auth.guard'
Require stack:
~/Documents/Code/nestjs-passport-learning/dist/src/user/user.service.js
~/Documents/Code/nestjs-passport-learning/dist/src/user/user.module.js
~/Documents/Code/nestjs-passport-learning/dist/src/app.module.js
~/Documents/Code/nestjs-passport-learning/dist/src/main.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
This error makes no sense, though, as the user module/service is not looking for that auth file at all. It was at one time, but I removed it while trying to debug the error. It seems like something internal to node itself is bugged and still looking at an outdated version of the code.
What happened:
Code was working/running perfectly
I decided to add "UseGuards(JwtAuthGuard)" to one of my user.service methods
At the same time I decided to setup debugging, so I added a launch.json file
Tried running the code. It built, but had a ton of "can't find bla bla" errors at runtime.
I stopped the app and figured the error was do to me not exporting the class in auth.module and not importing the AuthModule in UserModule(which was true).
I fixed that error, and restarted
Now getting the error message above
I removed the "UseGuards(JwtAuthGuard)" and all imports to it and AuthModule import in UserModule, as well as the launch.json file(ie revert back to exactly the code that was running perfectly 10 minutes earlier)
Still getting the same error(despite there being nothing in the user module that looks for it.
Why is user.service.ts still looking for that jwt-auth.guard.ts file?
Other things I've tried:
removing the "jwt-auth-guard.ts" file itself
checking out an earlier version of the code where "jwt-auth-guard.ts" hadn't even been written yet
restarting my machine
Nothing worked, no matter what, I get that same error, despite the code not being any different the code that worked.
link to github repo
Any help would be greatly appreciated, as I have no idea what's going on, and no idea what to google to even try to fix this problem.
Alright, so after some fiddling in my application, I tried renaming my 'dist' folder to try it, and it worked! So I guess the "caching" was due to the dist folder.
Peace and happy coding!
I have managed to build my angular app out as a dev build. I haven't done it as a production build yet as it gives me a few errors and i just need to test the dev build.
The dev build process goes fine, no errors or anything. I then use the files from the dist folder in a nginx docker container to host the files.
The problem is nothing is displayed but a white page and in the console i get an error saying 'Uncaught TypeError: Cannot read property 'id' of undefined'. The full message below doesn't seem to point to anything i have written and i've spent several hours searching online but can't find anything on this problem.
I've tried a few different things such as running 'npx ivy-ngcc' which i read manually compiles some stuff. Is there anyway i can get more details on the error to see if it's something i have done?
UPDATE
So i have restored the line that i commented out in main.ts as mentioned in the comments below. I have also tried 'ng build --aot' as suggested which presents me with a series of errors that all seem to relate to devextreme components that are used. I find this strange as i started the project with the devextreme angular starter project from github.
i get messages such as:
'dx-scroll-view is not a valid HTML element'
'node_modules/devextreme-angular/ui/drawer.d.ts - error: appears in
the NgModule.imports of SideNavOuterToolbarModule, but could not be resolved to an NgModule class'
If you go in the devtools and click on Sources, "Don't pause on exceptions" and check "Pause on caught expecptions" and continue until you get the "id error" you will find what module the error is thrown. In my case was a third party library called 'ngx-card/ngx-card' and it's module was the cause of the error (CardModule). Hope this will help find at least the cause of the error
I managed to solve the problem by disabling ivy in the angular compilation options. As soon as i did that it worked building both dev and production versions and is now working perfectly within Nginx.
Thanks to everyone who offered help :)
In tsconfig.json of your Angular project, put this to disable Ivy, the new Angular template engine
{
...
"angularCompilerOptions": {
"enableIvy": false
}
}
Typically, if it's not something that you've written, it tends to be an issue w/ your implementation - i.e. "Visiting a food vendor and ordering a food item they don't provide".
I know it's not a specific answer, but ensuring that you have appropriately configured things in your app.module would be a good first step. Perhaps attempting to build w/ AOT will also give you some more verbose failures that stem from attempting to build out.
Hopefully this helps another poor soul.
To anyone using devextreme, make sure you update your version to at least 19.2.5
https://github.com/DevExpress/devextreme-angular/issues/975#issuecomment-580172291
Starting with version 19.2.5 we support the IVY compiler.
I had the same issue and fixed it by changing from
loadChildren: './app/page/account/account.module#AccountModule'
to
loadChildren: () =>
import('./app/page/account/account.module').then(
(m) => m.AccountModule
)
in app-router.module.ts
The root cause of your error is very likely to be a module that you needed to load explicitly but didn't, or a circular reference in your own modules. Rodrigo has a good answer but to be more specific, you need to find the registerNgModuleType function in Angular's core.js and set a conditional breakpoint on the first line. The condition should be !ngModuleType || !ngModuleType.ɵmod. (You can set a conditional breakpoint in most modern browsers by right-clicking the line number.)
Once you've paused execution just before the exception happens, you can look at the value of ngModuleType if it's not undefined, or walk up a frame or two in the scope and see what the value of imports was.
For me, this issue occurred while using Storybook.
The reason it happened was because of the way I was precompiling the node modules. I was doing:
Incorrect
ngcc --properties es2015 browser module main --first-only
Correct
ngcc
Using this approach fixed it
I got stucked in this rude error, please suggest some solution to it.
When I creates new_project -> Map_Activity for the first time,
I got this error:
Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:11:5-39:19 to override.
But when I pasted
'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:11:5-39:19 to override
Then, I got new error:
Manifest merger failed with multiple errors, see logs
I'd looked for some of solutions on stackoverflow and github, but my error is not resolving.
All files are default, I had'nt made any change even then the error is coming from default :(
Your solution would be a great help for me. Please give your ideas in order to resolve this issue with newProject with MapActivity. Thanks in advance.
To solve it, just add the following line in your gradle.properties file:
android.enableJetifier=true
android.useAndroidX=true
this should be in your build.gradle
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
Hope this will help. I resolved the issue by doing this
I'm very new to Node.js and right now I'm looking at the traceback after an error. The traceback starts with something promising:
buffer.js:140
throw new TypeError('must start with number, buffer, array, or string')
The question is: how to find this buffer.js so I can start investigating?
Context and what I've done:
It's a custom app and I started it with babel-node index.js. I have little knowledge about babel or other such machinery.
I've searched the app's directory for buffer.js. I've found two files called buffer.js, but neither of them has this line 140 or anything resembling that.
From what I see babel-node is installed in my AppData/Roaming/npm. It's installed “globally”; again, I'm not quite sure what it means, maybe that it's on PATH. I've searched that directory as well and found (the same) two buffer.js files, neither of which is relevant.
My understanding is that this is a Node.js app, so I've searched the Node.js directory. Here I found two different buffer.js files from some promzard, but they're not what I'm after.
So how do I locate this file? Where else to look? Could it be that it's embedded into something and thus the name just a remnant?
Print the exception stack trace this will help you and it will show the complete path how error produced and at which line and file generating the error.
Write the following line in your function where you are catching the exception.
console.log(ex.stack);
I am trying to learn about the encryption of DB at application level using this tutorial. But I am getting an error that says
sqlcipher/sqlite3.c:11033:25: error: openssl/evp.h: No such file or directory
sqlcipher/sqlite3.c:11034:26: error: openssl/rand.h: No such file or directory
sqlite3.c:11035:26: error: openssl/hmac.h: No such file or directory
and due these there are around 93 more errors in the build process. I have strictly followed the tutorial but I am not able to get rid of those errors.
I have added the path of the source code as instructed in the tutorials but still the problem persists. The screenshot could be seen here
I had the same problem, in my case it was caused by a space in my OPENSSL_SRC path. Enclosing the value of OPENSSL_SRC in double-quotes fixed the problem.
The error messages you are seeing indicate that the compiler can't find the OpenSSL headers included in the SQLCipher code. The most likely problem is that you didn't add the OpenSSL headers to your include path when setting up your project. Perhaps you missed this step in the tutorial: "Look for the “Header Search Paths” setting and add references to $(SQLCIPHER_SRC) and $(OPENSSL_SRC). Check “recursive” on both."
As an aside, the information on that MO article is dated. In the future you can refer to this updated tutorial on the SQLCipher website: http://sqlcipher.net/documentation/ios
After long time i'm not sure whether you fixed this issue or not anyway to fix this do as follows:
In OPENSSL_SRC change destination from "/openssl-1.0.0d" to "/openssl-1.0.0d/include".
thatz it..it has to work.