Getting started creating a new event source (Reddit)

SERW2039 : No, it didn’t, so. When it comes to deploying using pd dev with the pd cli, I get an 500. This error occurs when I include the source file with the const reddit = require("../../reddit.app.js"); statement on top. Here’s the screenshot:

SERW2039 :

SERW2039 : The other error is with $auth variable being null. THat occurs when I deploy the source file without the app file statement. This is wierd because I have a previous source version where $auth is set properly.

SERW2039 : Screnshot:

SERW2039 : screenshot with partial code of the source, but maybe I can share with the PD UI to you?

Dylan Sather (Pipedream) : The absence of the app file causes this second issue. If you’re no longer requiring the app file, this.reddit is undefined, which is why the error notes that the program can’t read $auth of undefined.

The other error is interesting. Can you add the app file reference back in, then cd into sources/new-link-on-a-subreddit/, and pd dev new-link-on-a-subreddit.js?

Dylan Sather (Pipedream) : Can you also run pd --version?

SERW2039 : pd version 0.1.47

SERW2039 : I get the same error.

Dylan Sather (Pipedream) : I see the exception, checking

SERW2039 : Just a note, I guess is expected. I was running pd dev from the pd cli folder. So, in order to be able to run pd dev from the source folder itself, i added the pd cli to the window’s path environment variable.

Dylan Sather (Pipedream) : we should probably add that to the CLI docs

SERW2039 : yep, and the equivalent for linux and othe other supported OSs

Dylan Sather (Pipedream) : just to confirm, did you download the Windows native build (pd.exe ), or are you using the WSL build?

Dylan Sather (Pipedream) : Do you happen to run WSL?

SERW2039 : i definetely used the wndows native.

SERW2039 : No, i don’t run Windows Subsystem for Linux (which I guess is what WSL stands for in this case)

Dylan Sather (Pipedream) : that’s correct. So the good news is you helped us find a bug with pd dev on Windows. I raised this with the team and we’re planning to address it. In the meantime, would you mind going back to the actions backlog and work on that until we address this? Apologies for the back-and-forth!

SERW2039 : For sure, will move to the actions backlog. No worries, all right.

SERW2039 : That was bug with pd dev on Windows was resolved, I wanted to ask here this *which thought could be useful in this channel). Is there a way I can create files with the code content of a component (i’ve been working with sources) in my account? i.e. if i had the reddit source new links on subreddit, composed of an app file reddit.apps.js and the source code itself new-link-on-subreddit.js, is it possible that the files are greated locally pulling them with pd dev or some other command on the pd cli?