Cypress 10 throws error readying js config file: SyntaxError: /frontend/cypress.config.js: Unexpected token c in JSON at position 0 - continuous-integration

I'm trying to update transition our CI e2e runs to run Cypress 10.x. It runs on a Docker container via BuildKite and it's currently loading 10.11.0. It was previously complaining that it couldn't find the config file (using js format cypress.config.js). I pointed the cypress run CLI to the file using --config-file param and now the file is being found but I'm getting an error that seems to be expecting the old json config file format
SyntaxError: /frontend/cypress.config.js: Unexpected token c in JSON at position 0
Cypress versions on the container show as:
Cypress package version: 10.11.0
Cypress binary version: 10.11.0
Electron version: 21.0.0
Bundled Node version: 16.16.0
I don't see a config file format flag in the cypress run CLI documentation but it seems like Cypress 10 should not be having this issue. Don't see this exact issue when I search github/SO/google. Any thoughts?

Related

Error response from daemon: No such image: localstack/localstack:0.14.0

Recently I had this error
Error response from daemon: No such image: localstack/localstack:0.14.0
when setting up gnomock.
I was getting the error on this line
gmock, err = gnomock.Start(preset, gnomock.WithDebugMode(), gnomock.WithUseLocalImagesFirst())
The test is passing when I test on my machine, but when ran on gitlab's runners it was throwing the error I mention above.
The solution was to clear the cache of the runners.
The internet do not say much about this error. My theory is that because the mock was used in a sub package of the project (wrapped around), labstack got an update, and somehow that did not prop the docker images correctly.

How to debug #graphql-codegen/cli

Having difficult understanding where these errors are coming from. Adding --verbose and --debug to the command do nothing. I just want to know specifically what is causing the schema to fail to load. No matter what url I provide, it always fails. This wasn't happening before.
Is there any way to troubleshoot this I'm not seeing?
(node:11248) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[STARTED] Parse Configuration
[SUCCESS] Parse Configuration
[STARTED] Generate outputs
[STARTED] Generate src/generated/graphql.tsx
[STARTED] Load GraphQL schemas
[FAILED] Failed to load schema
[SUCCESS] Generate outputs
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I think it should be fixed if you upgrade your #graphql-codegen/cli.
Check documentation:
https://the-guild.dev/graphql/codegen/docs/config-reference/codegen-config#debug-mode
Check issue:
https://github.com/dotansimha/graphql-code-generator/issues/925#issuecomment-468618967
$ graphql-codegen --debug --config codegen.yml
✔ Parse Configuration
⚠ Generate outputs
❯ Generate to src/types/api/index.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ GraphQL Document Validation failed with 23 errors;
Error 0: Cannot query field "..." on type "..."

Strapi error: "Unexpected end of JSON input"

I am trying to add strapi-provider-upload-google-cloud-storage to strapi project but getting an error when app started:
Invalid json environment variable GCS_SERVICE_ACCOUNT: Unexpected end of JSON input
OS: Windows
Strapi version: 3.6.2
Open .env file
Remove all the line break and spaces from GCS_SERVICE_ACCOUNT's value.
Be aware there are issues when working with Strapi on windows besides the mentioned problem.

I'm getting issues in running nightwatch test cases in local configuration. For all browsers there's different issue which are listed as below:

Edge:
Error: An error occurred while retrieving a new session: "Unable to create new service: EdgeDriverService"
Chrome:
Error: An error occurred while retrieving a new session: "Unable to create new service: ChromeDriverService"
Firefox:
Error: An error occurred while retrieving a new session: "Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binale to find binary in default locatiory flag set on the command line"
This looks to me like a configuration issue. Assuming that you are using nightwatchjs without selenium, you need to ensure that the runner is able to find the chromedriver and geckodriver binaries. You can check my sample repo here. If you are using selenium, then you can check here.

Cannot run in production mode

I have a donejs application and its running ok in development mode donejs develop, but when I run it in production mode:
donejs build
donejs deploy (to firebase)
NODE_ENV=production donejs start
it will not start and show an error (see CODE A)
This file: file:my-app/dist/bundles/my-app/index.js:704 corresponds to JQuery 3.x and its not a dependency of the project itself but a dependency of can-connect-feathers (https://github.com/canjs/can-connect-feathers). In fact in index.js there is also included JQuery 2.x what makes me think there might be some sort of incompatibility among them.
I already tried changing the project's dependency to JQuery 3.x but didn't help. Actually it will make even donejs develop fail (see CODE B).
I also tried the following:
cd my-app/node_modules/steal
npm install
but didn't help, another error appears and finally tried cd my-app/node_modules/can && npm install but that end up in multiple errors.
I'm using:
donejs#0.9.2
node#4.6.2
npm#2.15.11
can-connect-feathers#1.2.1
CODE A
NODE_ENV=production donejs start
my-app#0.0.0 start my-app
done-serve --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [5] TypeError: Error loading "package.json!npm" at file:my-app/package.json
Error loading "bundles/my-app/index" at file:my-app/dist/bundles/my-app/index.js
Error evaluating file:my-app/dist/bundles/my-app/index.js
Cannot read property 'createElement' of undefined
at i (file:my-app/dist/bundles/my-app/index.js:704:20)
at file:my-app/dist/bundles/my-app/index.js:1039:2881
at file:my-app/dist/bundles/my-app/index.js:1039:3580
at file:my-app/dist/bundles/my-app/index.js:268:21
at file:my-app/dist/bundles/my-app/index.js:268:27
at Object.exports.runInThisContext (vm.js:54:17)
at doEval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:2059:10)
at __eval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1976:7)
at Loader.exec [as __exec] (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:339:5)
at Loader.loader.instantiate (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1517:16)
CODE B
donejs develop
my-app#0.0.0 develop my-app
done-serve --develop --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [8] Error: Error loading "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at <unknown>
Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "done-autorender#0.8.0#autorender" at file:my-app/node_modules/done-autorender/src/autorender.js
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
Potentially unhandled rejection [16] Error: Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at file:my-app/src/index.stache
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
If the double jQuery installation is the issue, it should be resolved by version 2.0.0, which is exactly the same as the 1.0 version, but requires that you pass in a jQuery package as the jquery option. So, in addition to whatever else you had in your can-connect-feathers config, you'll need to provide the jquery option:
import $ from 'jquery'
import Feathers from 'can-connect-feathers';
new Feathers({
jquery: $
});

Resources