Skip to content

Protocol "https:" not supported. Expected "http:" #103

Open
@richard-thai

Description

@richard-thai

I’ve added MSW (v2.4.3) into our project to mock the API requests, but after doing so, I encountered the following error:

[ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:" (see the stack trace below).

The full stack trace is attached below for reference. I’m currently using Next.js (v14.2.12) and msw (v2.4.3), and the error seems to occur when handling https requests within a Node.js environment.

Your help would be greatly appreciated. Thank you in advance for your support.

@example/web:dev: ⨯ TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:" @example/web:dev: at new ClientRequest (node:_http_client:183:11) @example/web:dev: at new _NodeClientRequest (webpack-internal:///(instrument)/../../packages/mock/node_modules/@mswjs/interceptors/lib/node/chunk-CVV3L375.mjs:22 9:5) @example/web:dev: at Object.interceptorsHttpRequest [as request] (webpack-internal:///(instrument)/../../packages/mock/node_modules/@mswjs/interceptors/lib/node/ chunk-CVV3L375.mjs:847:12) @example/web:dev: at eval (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/nodeHttpClient.js:199:145) @example/web:dev: at new Promise (<anonymous>) @example/web:dev: at NodeHttpClient.makeRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/nodeHttpClient.js:198:16) @example/web:dev: at NodeHttpClient.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/nodeHttpClient.js:120:36) @example/web:dev: at eval (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js:57:32) @example/web:dev: at Object.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/policies/logPolicy.js:31:24) @example/web:dev: at eval (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js:55:31) @example/web:dev: at Object.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/app-configuration/dist-esm/src/appConfigCredential.js:36:20) @example/web:dev: at async Object.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/app-configuration/dist-esm/src/internal/synctokenpolicy.js:32: 30) @example/web:dev: at async Object.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/policies/redirectPolicy.js:27:30) @example/web:dev: at async Object.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-rest-pipeline/dist/esm/policies/retryPolicy.js:39:32) @example/web:dev: at async Object.sendRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-client/dist/esm/deserializationPolicy.js:41:30) @example/web:dev: at async AppConfiguration.sendOperationRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-client/dist/esm/serviceClient.js:119:3 3) @example/web:dev: at async AppConfiguration.sendOperationRequest (webpack-internal:///(rsc)/../../node_modules/@azure/core-http-compat/dist/esm/extendedClient.js :50:24) @example/web:dev: at async eval (webpack-internal:///(rsc)/../../node_modules/@azure/app-configuration/dist-esm/src/appConfigurationClient.js:282:30) @example/web:dev: at async Object.withSpan (webpack-internal:///(rsc)/../../node_modules/@azure/core-tracing/dist/esm/tracingClient.js:39:28) @example/web:dev: at async Object.getPage (webpack-internal:///(rsc)/../../node_modules/@azure/app-configuration/dist-esm/src/appConfigurationClient.js:187:38) { @example/web:dev: digest: '3030512967', @example/web:dev: page: '/' @example/web:dev: }

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions