I am trying to integrate Snowflake in my Cypress tests but it keeps on throwing error while compiling. Error:
Error: Webpack Compilation Error
./node_modules/vm2/lib/resolver-compat.js
Module not found: Error: Can't resolve 'async_hooks' in 'C:\snowflake\node_modules\vm2\lib'
resolve 'async_hooks' in 'C:\snowflake\node_modules\vm2\lib'
Parsed request is a module
using description file: C:\snowflake\node_modules\vm2\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
Tried the following simple steps:
- Installed Cypress
- Installed snowflake-sdk through npm
- Created a spec file and imported:
const snowflake = require("snowflake-sdk");
When I run the spec file, I am getting the error as above.
If I trace the error to the file resolver-compat.js
, I can see the import where it fails.
const {AsyncResource} = require('async_hooks');
I have manually done npm install async_hooks
but no luck there also.
package.json
"devDependencies": {
"cypress": "^11.2.0"
},
"dependencies": {
"async_hooks": "^1.0.0",
"snowflake-sdk": "^1.6.16"
}