Opening Cypress gives an error in not finding resource.pak - npm

I'm trying to add End to End testing to my application through Cypress, however I've run into the issue that, after installing cypress through "npm install cypress" the command listed in their documentation "npx cypress open" will not work. It gives the following error.
`[35608:0112/105037.652:ERROR:resource_bundle.cc(991)] Failed to load C:\Users\User\AppData\Local\Cypress\Cache\12.3.0\Cypress\resources.pak
Some features may not be available.
Error: Cannot find module 'socket.io-client/dist/socket.io.js'
Require stack:
C:\Users\User\AppData\Local\Cypress\Cache\12.3.0\Cypress\resources\app\packages\socket\index.js`
What I've tried is a fresh reinstall of cypress, specifically adding socket.io and socket.io-client globally. I've also looked into the file path of resource.pak and have confirmed the folder is there.

Same issue here. Downgraded to 12.1.x to make it work again.

Related

ESlint problem with Cypress while using Vite

I wanted to try automated testing with Vue3 for my next project.
When I created my app using Vite and selected that I would like to test with Cypress everything seems to work fine but...
Although project starts like it suppose to when i type in console npm run lint I receive an error message saying:
C:\Users\myname\Desktop\vue-project\cypress\support\component.js
27:1 error 'Cypress' is not defined no-undef
and this is the line in which error occurs:
Cypress.Commands.add("mount", mount);
Any help from you guys would be appreciated
Ok so maybe someone will find it helpful.
It appears that problem with this one considers mainly ESlint.
If you can not run Cypress with command npm run test:unit:
make sure Cypress is also installed globally.
Then simply ignore ESlint errors considering cypress and don't change this line - const { defineConfig } = require("cypress"); even if lint suggest
doing it.
Congrats, you now should be able to run tests with Cypress :)
Bonus: if you do mind errors in your console and wanna keep it clean you search for some lint setup considering Cypress, to find a good setup for your lint if you do mind errors in your console.'eslint-plugin-cypress' didn't do the trick for me.

Cannot find module '../.../app/constants' when running npx #adobe/reactor-sandbox

I'm developing an extension in the Adobe Launch API, and everything was working fine with the command until this morning. Now when I run it, I receive the following error.
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '../../app/constants'
Require stack:
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\tasks\constants\files.js
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\tasks\helpers\getExtensionDescriptor.js
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\tasks\run.js
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\cli.js
I've tried reinstalling the individual package, as well as running npm install as a whole. My project has never contained a
../../app/constants
and has worked before without this error. Any ideas?

How to fix relative module error for a newly created nuxt.js app with starter template?

I tried to create a nuxt app with the guide from the official website, chose default options because I wanted the starter template but on running npm run dev, I keep encountering the error:
This relative module was not found:
* ./components/nuxt-error.vue in ./.nuxt/index.js
I've tried searching about it but I couldn't find any useful resource/fix. I've also tried vue init nuxt-community/starter-template for the installation but I still get the same error.
Any fixes?
So I found a solution. I couldn’t figure out the error because the nuxt-error.vue file was actually imported correctly. Turns out “npm” installations have been giving me issues (had issues with TailwindCSS too).
So if you ever encounter this error on loading the base nuxt app, recreate the project using “yarn” instead. Works like magic!
This Error basically means, that in one of your files you are trying to import another file with the relative path of ./components/nuxt-error.vue but no file with this path exists.
However
I just read that vue init nuxt-community/starter-template is deprecated and no longer maintained. Instead of fixing this Error you should restart your project with npx create-nuxt-app <yourAppName>. https://github.com/nuxt-community/starter-template

“Page Not Found” when navigating to site created with Gridsome & deployed on Netlify

I've created a new site using Gridsome deployed with Netlify, but I can't get the site to appear when accessed. Instead, Netlify says:
Page Not Found
Looks like you've followed a broken link or entered a URL that doesn't exist on this site.
< Back to our site
I tried updating my build settings based on the instructions of the creator of the Gridsome starter template I'm using, but the site still doesn't display. I've also updated the js-yaml version.
I've gone through the questions/answers for similar questions on here, but I haven't been able to figure this out. I'm new to web development, and I'm sure I'm missing one or more things contributing to the issue.
My GitHub repo for this site.
The site.
I have the build log from Netlify. There are some errors in it. I don't want to put too much here, so here's a part from the end of the log.
12:18:36 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
12:18:36 PM: Error running command: Build script returned non-zero exit code: 1
12:18:36 PM: Failing build: Failed to build site
12:18:36 PM: Finished processing build request in 55.729813394s
A Gist for the whole build log.
Thanks so much for your help, #talves!
I was having trouble using the build commands because of being new to cli stuff and a permissions issue. I asked a friend about the build errors I was getting from Netlify, and he recommended I try removing and re-installing my node modules. Did that, still didn't work. I tried removing anything in the repo having to do with "journal" since Failed to render /journal kept appearing in the build log, but that didn't work either.
I googled ReferenceError: _objectSpread is not defined after update since that was in the build log after the journal error. I found a comment on an issue noting the same error message in the main Babel GitHub repo that suggested adding the following to the package.json file:
"resolutions": {
"#babel/core": "^7.5.4"
}
I added it, tried to build again, and it still failed but only gave me one error message it didn't show before—Error: SyntaxError: Unexpected string in JSON at position. I googled that message and got another issue on GitHub. A comment on the issue noted a missing comma.
I went back to my package.json file and found that I didn't add a comma to the bracket above the new "resolutions" snippet. I added the comma, tried to build again, and it worked 🤜💥✨ !
Sorry if this is long-winded! I thought it might be good to include my process on figuring this out in case others run into the same issues.

Getting error "read ECONNRESET" while creating a new stenciljs project. How to fix the same?

I am trying to create a new stenciljs project using command npm init stencil. As soon as I choose a set up (whether app or component) and hit 'enter', a read ECONNRESET error is prompted.
I have tried updating the npm but nothing is working.
I expect the command prompt to show me the option where I can enter the project name after choosing a setup for my project but it throws an error, instead.
An ECONNRESET in npm means that npm is unable to connect to an URL where it's looking for dependencies or resources. In most cases, that means that your npm is unable to connect to the NPM Registry. But in your case it seems different.
You're trying to create a Stencil app, with npm init stencil. Under the hood, that That means you're using npm to download the create-stencil package and run it to generate the scaffold of your Stencil app.
The first part, getting the create-stencil package works well, the problem arrives while running the package. If I am correct, create-stencil tries to clone the stencil-app-starter GitHub repository and modify it. So maybe you're behind a corporate or university proxy, blocking GitHub, or another the URLs of the create-stencil resources, maybe the connection is rather flacky, maybe GitHub was done at that moment...