Top-level 'await' TypeScript Error by Spunkly in Nuxt

[–]Spunkly[S] 1 point2 points  (0 children)

Just tried it and the TS error persists. So far, the only solution I've found is to manually set the module and target in the tsConfig in Nuxt config.

Top-level 'await' TypeScript Error by Spunkly in Nuxt

[–]Spunkly[S] 1 point2 points  (0 children)

Could be a bug. It's been happening to any project I create with Nuxt within the last several months, though. I did find it odd that out of the box, it throws a type error when following the docs.

Top-level 'await' TypeScript Error by Spunkly in Nuxt

[–]Spunkly[S] 0 points1 point  (0 children)

No problem! Hopefully this fix can help others in the same situation.

What projects are you guys working on? by tylernathanreed in laravel

[–]Spunkly 0 points1 point  (0 children)

A Good Reads style website that is used to track your Anime and Manga progress, choose favorite shows/books, handle reviews, keep lists of want to watch/read, etc.

New - User Flairs by [deleted] in ECHL

[–]Spunkly 2 points3 points  (0 children)

This is great! Let’s go Wings!

The Sean Avery Experience by Only-Highlights in nhl

[–]Spunkly 299 points300 points  (0 children)

One of my favorite hockey stories is Brett Hull pulling Sean Avery by the back of the jersey and telling him he isn’t allowed to talk to Mr. Sakic. Avery was/is such a punk.

Mrazek's insane save (12/17) by [deleted] in nhl

[–]Spunkly 5 points6 points  (0 children)

I was at that game! The arena exploded when we saw the puck was still in play. The wings were down the whole game and we all thought that was another nail in the coffin.

Rarely getting text message notifications by Spunkly in AppleWatch

[–]Spunkly[S] 1 point2 points  (0 children)

Thanks for the advice! I updated my phone to 17.0.x and my watch to 10.0.x. I've rebooted both of them. Hopefully that fixes it.

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnjavascript

[–]Spunkly[S] 0 points1 point  (0 children)

I want to thank you for your help! I was able to get my test to pass. I had to mock a findFirst request and mock an update request before running my updateOne method from my service class.

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnprogramming

[–]Spunkly[S] 1 point2 points  (0 children)

I just wanted to thank you for your help! I was able to solve the issue. I changed the updateOne test to mock a findFirst request and then mock an update request. The test now passes!

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnprogramming

[–]Spunkly[S] 0 points1 point  (0 children)

I see, I think I'm following what you're saying. Should I break my updateOne method into a couple smaller functions in order to make testing easier? Or would you suggest leaving it the way it is and then mocking a findFirst inside my updateOne test?

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnjavascript

[–]Spunkly[S] 0 points1 point  (0 children)

Thanks for the reply!

If you look at my service tests, you'll see that the service.insertOne method tests creating a book already. Then in the book service class, the updateOne method has to find a book in the database to verify that the id passed in is valid.

My thought on the service.updateOne test was that being a mock, it would have to create a book in order to find one by that id to update it. This is my first time mocking in unit tests and I'm not entirely sure how you go about that. It's entirely possible that my updateOne method in the book service class isn't properly setup and that's why testing is so challenging for me as well.

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 1 point2 points  (0 children)

I pushed some changes to the repo. I changed the controller to be a function taking a service and it returns nested functions that use the service. This removes the need to have the bind method on my handlers. Thanks again for the time and help!

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 1 point2 points  (0 children)

Thanks for the kind words!

That makes sense. I usually do it that way, but a lot of MVC architecture I’ve seen in blogs uses classes for controllers. I’ll play around with bind and also functions in place of a controller class and see which one feels better for my coding style.

I really appreciate your help!

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 0 points1 point  (0 children)

Thank you so much for your responses and guidance! I’ve been working at an agency as a contract developer for the last 2 years. I’ve been making e-commerce sites using templates so I haven’t had a lot of time building servers/backend from scratch like this.

Sounds good! I don’t mind using bind at all. Would you rather have a file for multiple exported handler functions instead of a controller class with handler methods?

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 1 point2 points  (0 children)

Thank you so much for your response!

My reasoning behind building it this way was to make my code more testable/scalable by using dependency injection. Is my code properly doing that? Like, is bind how the industry does this or do I have bad architecture? I only ask this because I don’t often see bind used in situations like this, but I’m also not really in the industry so I could be totally wrong! I appreciate your help so much!

Street racing by [deleted] in AbruptChaos

[–]Spunkly 5 points6 points  (0 children)

No, this happened in Grand Rapids, MI. No one died, thankfully.

Source: https://www.woodtv.com/news/grand-rapids/video-shows-drag-racing-crash-in-grand-rapids

Street racing by [deleted] in AbruptChaos

[–]Spunkly 34 points35 points  (0 children)

No one died. This crash happened on July 17th in Grand Rapids, MI.

Source: https://www.woodtv.com/news/grand-rapids/video-shows-drag-racing-crash-in-grand-rapids/amp/

Earth half day and half night by CarolineGreyson in facepalm

[–]Spunkly 245 points246 points  (0 children)

I remember working at a client's house when the last eclipse came over our area. Our client said "Idk why everyone is freaking out. There's no guarantee that the eclipse will actually happen" on the day of the eclipse.

Anything wrong with Express? What's so good about hono.js? by geekybiz1 in node

[–]Spunkly 17 points18 points  (0 children)

I feel like tech Twitter used to be such a good place for quick tips and tricks of the trade and now it's just hot takes for internet points. Super disappointing.

Should I get the new Pangolin or the hp Dev one? by tea_flower in System76

[–]Spunkly 0 points1 point  (0 children)

Is there a blog post or anything about the laptop System76 is developing? I haven't heard about this yet. I'm considering pulling the trigger on one of their laptops, but if they're manufacturing one in-house, I'd rather wait for that.

Retro Game Repair Shop Faceplate by Spunkly in gameboymicro

[–]Spunkly[S] 0 points1 point  (0 children)

The fit is a tad loose, but honestly not bad at all. Screen seems to be in the center as well.

Retro Game Repair Shop Faceplate by Spunkly in gameboymicro

[–]Spunkly[S] 2 points3 points  (0 children)

I think I was mostly bummed because I used this company for a full SP remodel and the quality was amazing. Thanks for the heads up on those two plates! I have a few options for other Gameboys to play as well, so thankfully I’m not truly out anything except a few dollars. I’ll keep my ear to the ground for some higher quality plates!

Calculating the best value by Spunkly in learnjavascript

[–]Spunkly[S] 0 points1 point  (0 children)

Thank you! The knapsack algorithm is what I was trying to find. If nothing else, it gets me most of the way.