-
Notifications
You must be signed in to change notification settings - Fork 53
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
Error on the Add Contact worker #22
Comments
same here, even the repo's code produces the same error. |
Hi... can you tell me what IDE/editor you're using? I'm not seeing such an error in IntelliJ IDEA. Also, is the code compiling and running for you from a CLI? For me, it is, and it seems to run just fine. |
Hi.. I am using VS Code. Could that be the reason I'm getting an error? |
I just tried with IntelliJ IDEA and I got the same error. Screenshots: |
Hmm, interesting. I don't really use VSCode myself, but I'm using IDEA too and not seeing the same... I'm sure there's some inspection setting difference or extension or something... but, ultimately it shouldn't matter much if it's building and working from the command line. The projects are definitely set up not for any specific IDE or editor, the expectation is that it's built and run from the command line. There, I'm able to build and run both client and server without problems. Are you able to do the same? |
By running from the command line you mean typing the curl commands? When I type curl localhost/mailboxes as an example, I get: https://ibb.co/7JnrsyN |
No, sorry, I mean doing:
...in the client directory to build the client, then...
...in the server directory to build and start the server. Note that you'll need two separate command prompt windows since both steps monitor for changes after doing the build. I can try and figure out how to resolve what the IDE is showing you, but I'd like to at least make sure you can build and run the project so at least you aren't stuck first. |
It should be one of the node modules that's an issue, I ended up resorting to cloning the original server folder, and that worked just fine. |
I tried both commands, but I couldn't run the server. When I clone the repo, do I need to install all the NPM modules again ( |
yes, after cloning the repo, cd to the client folder and run |
Okay I ran |
Sorry, I didn't reply sooner, been battling an illness. You may have worked this out already, but if not, no, it doesn't launch the browser automatically. The server starts up, and then you manually have to access the URL mentioned in the book. To give you the entire flow, start to finish, starting with a fresh clone of the repo (and assuming Windows):
Note that both windows must remain open, because they are still executing, watching for changes in the code. You have to remember as well that you essentially have two separate projects here, that's why you have to install dependencies in both and run both in separate windows. However, note that if you don't intend to change the client code then you can close that window (or, in fact, you can do everything in one window), The server references the client project to serve the client to the browser, and once it's built then that's all that has to happen, but the project is set up so that you can make changes to it and "instantly" (with a browser refresh) see the changes. And, of course, make sure you update serverInfo.json with your SMTP/POP3 info before starting the server or things won't work. |
I hope all is well now. Actually I haven't had a chance to run it sooner either. I am going to test it now again. Thanks |
Yes, thanks, feeling much better now :) You would need to put valid info for some email server, but the values themselves could be anything. If it's not valid info though you'll find that you won't get past the initial please wait (it's fetching mailboxes, if memory serves) and you'll see some errors in the console for the server. Oh, and I just noticed I made a mistake earlier: this code used IMAP, not POP3. I haven't looked at it in a while and I forgot that. |
Hi, I followed the steps one by one, but when I ran Is my |
Hi, I feel like something else is wrong based on the errors you're seeing, but I'm not sure what frankly. However, the values you have in that file definitely don't appear valid to me. They must be valid values for your own SMTP and IMAP servers. You'll have to find out what they are. If you use Gmail, for example, you can get that info here: https://support.google.com/mail/answer/7126229?hl=en Otherwise, you'll have to find that information out from wherever your email is hosted (or you could run your own mail server if you like, but that would be completely up to you to set up). Once that's done, if you're still unable to start the app then like I said, I suspect something else may be wrong, but it isn't clear to me what it is... I just see some things there that don't look right (for example, you shouldn't be seeing in the second screenshot). It almost seems like maybe the compile step isn't working actually, but I can't see enough details to tell why. I know I tried this again last night and everything worked, so I'm kind of at a loss at the moment... but one step at a time, let's get the config part right first and go from there. |
Hi, And then I followed all the steps. I created this screen recording of my errors (feel free to skip ahead and watch from 4:05): |
Hi, Ok, so, I watched the video and the good news is I don't see that you're doing anything wrong, so it's not you :) The problem is that the build step for both the client and the server isn't working. All those errors you see fly by when you execute the So, that tells me that there's something on your machine that is conflicting in some way. Unfortunately, I don't know what it is, so we'll have to try and solve the mystery step by step. Let's start with this... execute the following command at a command prompt:
That will list the packages installed globally, but just the top-level ones. Let me know what you see. For reference, on my machine, I only see cordova, eslint, gatsby-cli, npm, and npm-check-updates. My first GUESS is that you maybe have an older version of Typescript, or maybe something else, installed globally, and it's conflicting with what's installed locally in the two mailbag projects. If you do see anything installed, and it's not something you know you need, try to remove it ( Also, let me know what version of both npm and Node you have installed ( Once all that's done, do a fresh pull of the repo and try everything again, see what happens, and let me know. Thanks, |
https://ibb.co/W3xc1v5 I updated node and npm both. I got the same error. |
Ok, what about the global packages? |
You mean |
Ah, sorry, I clicked the links on mobile and I guess maybe I tapped the same one twice and so didn't see the first one. Ok, anyway, none of them SEEM like they should be causing any trouble... however, to be safe, you may want to try uninstalling them all and see if that helps. I doubt it will though. The only other thought I have is have you tried this from a plain command window rather than the terminal tab in VSCode? It would surprise me, but I guess maybe it's POSSIBLE there's something about the terminal that's different from a command window? The tests I did were in command windows, which is what made me think of this. |
modern-full-stack-development/mailbag/server/src/Contacts.ts
Line 72 in 085ddc0
I get an error for the add contact worker. Does anybody know what the issue might be?
I take all the steps based on the textbook and source code, but the error still persist.
You can see the error on this screenshot:
https://ibb.co/PDX2kYv
The text was updated successfully, but these errors were encountered: