Skip to content
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

"__dirname is not defined" on trying to consume RSS feed #59

Closed
AlbertCaro opened this issue Sep 26, 2022 · 2 comments
Closed

"__dirname is not defined" on trying to consume RSS feed #59

AlbertCaro opened this issue Sep 26, 2022 · 2 comments

Comments

@AlbertCaro
Copy link

I have found another bug after update to 2.2.1 release:

Application booted at Mon, 26 Sep 2022 05:03:53 GMT
AlertHub RSS Feed server running at port 3444
file:///usr/src/app/src/utils/rss.js:114
        plugins_directories: [path.join(__dirname, '..', 'plugins', 'rss-braider')],
                                        ^

ReferenceError: __dirname is not defined
    at RssUtils.createRSSFeed (file:///usr/src/app/src/utils/rss.js:114:41)
    at Server.<anonymous> (file:///usr/src/app/src/index.js:144:14)
    at Server.emit (node:events:513:28)
    at parserOnIncoming (node:_http_server:1034:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)

And again, thank you in advance for your help.

@reconman
Copy link
Collaborator

Was caused by the migration to ES modules: https://stackoverflow.com/a/62892482

@reconman
Copy link
Collaborator

Wasn't familiar with the RSS code. Alerthub only used the RSS configuration when you sent a request to localhost:3444.

In my commit, I changed it so it fails on startup and I had to revert a few of the changes from #57.

You will need to change back the config.js to the old format of module.exports = when using version 2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants