fix(examples): application crashed when navigating examples in browser (#5938)

fix(examples): application crashed when navigating examples in browser (#5938)
This commit is contained in:
Nitin Ramnani 2025-01-31 00:55:28 +05:30 committed by GitHub
parent bba8e2e47d
commit 1260ded634
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,8 +128,8 @@ server = http.createServer(function (req, res) {
// Process server request
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
if (fs.existsSync(path.join(__dirname, url + '.js'))) {
import('./' + url + '.js').then(module => {
module.default(req, res)
import('file://' + path.join(__dirname, url + '.js')).then((server) => {
server.default(req, res);
});
} else {
send404(res);