Non-existant file still gets its success callback called
See original GitHub issueThe following prints out “shouldnthappen”
$script('doesntExist.js', function() {
console.log('shouldnthappen')
}, function(notFound) {
console.log(notFound)
})
This makes me think script.js isn’t in any way production ready.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to capture no file for fs.readFileSync()? - Stack Overflow
This will not work because the callback function passed to fs.readFile() is called asynchronously. By the time the callback has been called, the ......
Read more >Using C++ File Streams
If you try to open a file and it fails to open (e.g. the filename is wrong), the stream object goes into a...
Read more >open(2) - Linux manual page - man7.org
The file descriptor returned by a successful call will be the lowest-numbered file descriptor not currently open for the process. By default, the...
Read more >How to fix "The following module is missing from the file ...
This is caused by either improperly uninstalling modules and / or modules still trying to call non existent modules in their code (as...
Read more >On Error statement (VBA) | Microsoft Learn
When calling DLL functions, you should check each return value for success or failure (according to the API specifications), and in the event...
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 FreeTop 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
Top GitHub Comments
this is a valid concern but with all respect leave your sarcasm elsewhere. your request to change core is an opinion of which has been purposely decided in the library to load non-existent or errored files. you would otherwise never receive a callback and may mistakenly attempt to wait for an event that may never occur. it’s up to the developer to make sure their scripts load properly.
Eg:
@amorey the behaviour is fine, the documentation could be more verbose 😃