question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnhandledPromiseRejectionWarning when importing a file with unknown (or no) extension

See original GitHub issue

This happens in 1.8:

[ERROR] console - (node:27731) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
   at makeCallback (fs.js:136:11)
   at Object.rename (fs.js:578:14)
   at doImport (/opt/etherpad-lite/src/node/handler/ImportHandler.js:104:16)
   at process._tickCallback (internal/process/next_tick.js:68:7)

This happens when importing a file without known extension in the file name (e.g. no extension at all). As a workaround, you have to set the file name and let it end with an extension, e.g. .txt.


Edit by @muxator: this happens not only when no extension is given, but for every unknown extension (including none) when allowUnknownFileEnds in settings.json is true. Changed the title accordingly.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
muxatorcommented, Mar 17, 2020

Fixed pulling in #3722 by @tudorconstantin. Thanks everyone.

0reactions
raybelliscommented, Mar 17, 2020

Ah, I see @tudorconstantin already beat me to it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run my Node.js Typescript project TypeError ...
Can't run my Node.js Typescript project TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/src/App.ts · Ask Question.
Read more >
Error: unknown file extension .ts · Issue #1062 - GitHub
No matter what I do, I can't get beyond "Unknown file extension ".ts"". My project is in TypeScript, and I'm trying to import...
Read more >
unknown file extension - You.com | The AI Search Engine You ...
The issue. When an external package is importing / exporting a file type that is known to vite ( .vue ), the build...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
you're importing some things from an outdated package; you're pointing to a file that does not exist. In the screenshot below, you can...
Read more >
ECMAScript modules | Node.js v19.3.0 Documentation
Modules are defined using a variety of import and export statements. ... Including the file extension is only necessary for packages without an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found