vscode-elixir-test icon indicating copy to clipboard operation
vscode-elixir-test copied to clipboard

Tests do not run - TypeError: Cannot read properties of undefined (reading 'replace')

Open eriknaslund opened this issue 1 year ago • 2 comments

The extension stopped working for me, and I believe it was after a VSCodium update.

Steps to reproduce

  1. Have VSCodium 1.84.2 and elixir-text 1.8.1 installed.
  2. Try to "Run all tests on file".

Expected behavior

  • Tests should run.

Actual behavior

  • I see an error (under "Extension Host") stating the following:
2023-11-29 23:01:09.229 [error] TypeError: Cannot read properties of undefined (reading 'replace')
    at Re.sendText (vscode-file://vscode-app/opt/vscodium-bin/resources/app/out/vs/workbench/workbench.desktop.main.js:2610:2043)
    at s.$sendText (vscode-file://vscode-app/opt/vscodium-bin/resources/app/out/vs/workbench/workbench.desktop.main.js:1687:61417)

eriknaslund avatar Nov 29 '23 22:11 eriknaslund

The "Extension Host" issue was a bit of a red herring. The error is still there, and it probably should be fixed.

However the reason it didn't work for me any more was because I had modified my workspace and "mix test" was running from a directory where it couldn't find the mix.exs file.

eriknaslund avatar Dec 01 '23 22:12 eriknaslund

I'm seeing this. It works fine on 1.7 (I just rolled back to check), but not on 1.8.1. Jumping between the module and the unit test works fine, but executing the tests under the cursor or for the current file throws the following error:

2023-12-21 10:42:04.841 [error] TypeError: Cannot read properties of undefined (reading 'replace')
    at Ee.sendText (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2620:1566)
    at s.$sendText (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1684:51749)

Rolling back to 1.8.0 produces the following:

2023-12-21 10:47:50.530 [error] TypeError: Cannot read properties of undefined (reading 'length')
    at mix (/Users/tom/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/helpers/mix.js:7:47)
    at Object.testPath (/Users/tom/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/helpers/mix.js:36:10)
    at /Users/tom/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/commands/runTestFile.js:5:46
    at Object.onTestFile (/Users/tom/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/helpers/test.js:39:17)
    at Object.handler (/Users/tom/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/commands/runTestFile.js:5:8)
    at /Users/tom/.vscode/extensions/samuel-pordeus.elixir-test-1.8.0/src/extension.js:13:25
    at d.h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:141:140094)
    at d.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:141:140954)
    at l.S (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:10829)
    at l.Q (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:10595)
    at l.M (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:9685)
    at l.L (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:8764)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:7567)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:14039)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:7903)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:14039)
    at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6183)
    at MessagePortMain.emit (node:events:513:28)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367) extension.elixirRunTestFile {"value":"samuel-pordeus.elixir-test","_lower":"samuel-pordeus.elixir-test"}

I'm not sure how to provide more useful debug information, but if you'd like me to check anything, just shout.

tomtaylor avatar Dec 21 '23 10:12 tomtaylor