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

Building new translators issue: "ReferenceError: filename is not defined" #114

Open
Looxloox opened this issue Mar 21, 2020 · 3 comments
Open

Comments

@Looxloox
Copy link

Following the tutorial proposed by Wikimedia to build new translators, i constructed a "Wikimedia.js" file exactly the way it is described (you can see the file there ).
Unfortunately, i can't possibly restart the server after adding this new file to the translators directory (using Docker as well as npm).
The error is:
`> node src/server.js

(node:23034) UnhandledPromiseRejectionWarning: ReferenceError: filename is not defined
at Object.load (/home/abrul/Prog/translation-server/src/translators.js:129:77)
at async Object.init (/home/abrul/Prog/translation-server/src/translators.js:48:18)
(node:23034) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23034) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`
Any idea ?

@dstillman
Copy link
Member

dstillman commented Mar 21, 2020

We'll fix that ReferenceError but the message it's trying to display is "Invalid or missing translator metadata JSON object", which happens when the metadata at the top of the file can't be parsed as JSON.

@Looxloox
Copy link
Author

Looxloox commented Mar 21, 2020

Ok, i finally found syntax errors in the URL declaration ("\." instead of "\\.")
Thank you for your help

@dstillman
Copy link
Member

Leaving this open to fix the error message

@dstillman dstillman reopened this Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants