UnhandledPromiseRejectionWarning when importing a file with unknown (or no) extension
See original GitHub issueThis 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:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed pulling in #3722 by @tudorconstantin. Thanks everyone.
Ah, I see @tudorconstantin already beat me to it 😃