loganch / AutoIt-VSCode

AutoIt Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=Damien.autoit
MIT License
74 stars 25 forks source link

Runtime error during extension load #178

Closed Danp2 closed 1 year ago

Danp2 commented 1 year ago

From the logs --

2023-03-21 18:45:15.890 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:15.891 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:15.891 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:15.892 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:16.404 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:16.404 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:16.404 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957
2023-03-21 18:45:16.405 [error] TypeError: (0 , i.findFilepath) is not a function
    at c:\Users\danpo\.vscode\extensions\damien.autoit-1.0.10\dist\extension.js:1:3957

It appears to be coming from this line -- https://github.com/loganch/AutoIt-VSCode/blob/cc931607ae0b3fdae964e8caa940b159ae17eaae/src/ai_config.js#L159

This is what appears when debugging with Uncaught Exception breakpoints enabled --

Exception has occurred: TypeError: (0 , _util__WEBPACK_IMPORTED_MODULE_2__.findFilepath) is not a function
t c:\Users\danpo\OneDrive\Documents\GitHub\AutoIt-VSCode\dist\extension.js:1307:94

Any thoughts @vanowm?

vanowm commented 1 year ago

That is strange, I'm not getting any errors...

Danp2 commented 1 year ago

I get these errors when opening a project folder (even one not AutoIt related). To be clear, I didn't experience this with v1.0.10 but I do with v1.0.11.

Danp2 commented 1 year ago

Here are my smartHelp settings since this error appears to be related --

        "autoit.smartHelp": {
            "_AD_": {
                "chmPath": "C:\\Users\\danpo\\AppData\\Autoit.Advanced.Help\\AD.chm",
                "udfPath": [
                    "AD.au3"
                ]
            },
            "_OL_": {
                "chmPath": "C:\\Users\\danpo\\AppData\\Autoit.Advanced.Help\\OutlookEX.chm",
                "udfPath": [
                    "OutlookEX.au3",
                    "OutlookEX_Base.au3"
                ]
            },
            "_TS_": {
                "chmPath": "C:\\Users\\danpo\\AppData\\Autoit.Advanced.Help\\TaskScheduler.chm",
                "udfPath": [
                    "TaskScheduler.au3"
                ]
            },
            "_WD_": {
                "chmPath": "C:\\Users\\danpo\\AppData\\Autoit.Advanced.Help\\au3WebDriver.chm",
                "udfPath": [
                    "C:\\Users\\danpo\\OneDrive\\Documents\\GitHub\\WebDriver\\wd_core.au3",
                    "C:\\Users\\danpo\\OneDrive\\Documents\\GitHub\\WebDriver\\wd_helper.au3",
                    "C:\\Users\\danpo\\OneDrive\\Documents\\GitHub\\WebDriver\\wd_cdp.au3",
                    "C:\\Users\\danpo\\OneDrive\\Documents\\GitHub\\WebDriver\\wd_capabilities.au3"
                ]
            }
        }
vanowm commented 1 year ago

So the issue is because util.js is using ai_config.js and ai_config.js is using util.js The only way I could think of to fix this is to move findFilepath function into ai_config.js

Danp2 commented 1 year ago

@vanowm Interesting find.