Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes and small enhancements #11

Merged
merged 3 commits into from
Nov 7, 2021
Merged

Bugfixes and small enhancements #11

merged 3 commits into from
Nov 7, 2021

Conversation

This was referenced Nov 4, 2021
@peitschie
Copy link

For some reason, this branch is giving me this error when I try and use the extension:

[2021-11-04 06:18:36.758] [ERROR] [Adapter]: Failed to load tests - Test discovery failed: Browser Error - An error was thrown in afterAll
Uncaught Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (89)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
    at module.exports (J:\work\some-project\mobile-app\source\app\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (J:\work\some-project\mobile-app\source\app\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:1125:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Module._load (internal/modules/cjs/loader.js:823:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:1006:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at getDefaultSassImplementation (J:\work\some-project\mobile-app\source\app\node_modules\sass-loader\dist\utils.js:42:10)
    at getSassImplementation (J:\work\some-project\mobile-app\source\app\node_modules\sass-loader\dist\utils.js:50:30)
    at Object.loader (J:\work\some-project\mobile-app\source\app\node_modules\sass-loader\dist\index.js:34:59)
Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (89)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
    at module.exports (J:\work\some-project\mobile-app\source\app\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (J:\work\some-project\mobile-app\source\app\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:1125:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Module._load (internal/modules/cjs/loader.js:823:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:1006:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at getDefaultSassImplementation (J:\work\some-project\mobile-app\source\app\node_modules\sass-loader\dist\utils.js:42:10)
    at getSassImplementation (J:\work\some-project\mobile-app\source\app\node_modules\sass-loader\dist\utils.js:50:30)
    at Object.loader (J:\work\some-project\mobile-app\source\app\node_modules\sass-loader\dist\index.js:34:59)
    at Object.OEKy (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:57768:7)
    at __webpack_require__ (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:20:30)
    at Object.t+Ps (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:135384:27)
    at __webpack_require__ (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:20:30)
    at Module.main (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:124748:76)
    at __webpack_require__ (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:20:30)
    at Module.c3R7 (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:104765:67)
    at __webpack_require__ (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:20:30)
    at Module.i0VB (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:119379:68)
    at __webpack_require__ (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:20:30)
    at webpackContext (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:82209:9)
    at Array.map (<anonymous>)
    at requireAllInContext (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:47484:32)
    at Array.forEach (<anonymous>)
    at runTests (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:47480:12)
    at Module.<anonymous> (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:47469:1)
    at Module.Ivzx (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:47487:30)
    at __webpack_require__ (http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:20:30)
    at http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:84:18
    at http://localhost:9977/base/test/karma-bundle.js?809142f8c3201b9437491c04337786f3a369e211:87:10
[2021-11-04 06:18:36.761] [INFO] [Adapter]: Finished loading tests in 24.32 secs (Failed)

I can run npm run test manually without issue, and there's no global node-sass implementation installed. It's only when karma is being invoked by the extension here that it seems to fail 🤔

I'll troubleshoot a bit more soon!

@peitschie
Copy link

If I pass in the full path to the local karma install, this works. E.g., adding this to the project's settings.json:

  "karmaTestExplorer.karmaProcessCommand": "j:/work/some-project/mobile-app/source/app/node_modules/.bin/karma.cmd",

Things also work if the command in the launchers to be node instead of process.execPath (which is code.exe):
image

@peitschie
Copy link

I think what's going on here is that the node version code.exe pretends to be is different to the node version I have on path. The node-sass is a compiled output, and isn't able to run with the different version of node on Windows.

If I instead adjust this to use the node on path, then it works as expected because it's the runtime node-sass was compiled for.

@lucono
Copy link
Owner Author

lucono commented Nov 6, 2021

@peitschie Thanks for troubleshooting that. It should now use the node executable from PATH, only falling back to code.exe when that's not found. Can you verify again with your project setup? Thanks.

@peitschie
Copy link

That worked perfectly on all the codebases I tried it with 🎉

Thanks so much for this 😺

@lucono
Copy link
Owner Author

lucono commented Nov 7, 2021

@peitschie Great, I've published it to the marketplace. Feel free report any future issues you run into. Thanks.

@lucono lucono merged commit 76a1e93 into master Nov 7, 2021
@lucono lucono deleted the beta branch November 9, 2021 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants