Error encountered while executing vitest within DevContainer

Recently, my company transitioned to DevContainer. I had a few PACT tests that were running successfully with vitest in my local environment. However, upon moving to DevContainer, I encountered the following error when attempting to run the same command:

Command used to run tests :

vitest run src/contract-test/consumer/action-consumer.test.ts

Error Message :

RangeError: Maximum call stack size exceeded
    at get hasIndices [as hasIndices] (<anonymous>)
    at get flags [as flags] (<anonymous>)
    at String.matchAll (<anonymous>)
    at _searchLast (file:///app/.yarn/__virtual__/vite-virtual-68526d8c1a/0/cache/vite-npm-5.0.11-d5457a8b86-74a3ddc6d4.zip/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:38476:34)
    at _interpolate (file:///app/.yarn/__virtual__/vite-virtual-68526d8c1a/0/cache/vite-npm-5.0.11-d5457a8b86-74a3ddc6d4.zip/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:38509:12)
    at _interpolate (file:///app/.yarn/__virtual__/vite-virtual-68526d8c1a/0/cache/vite-npm-5.0.11-d5457a8b86-74a3ddc6d4.zip/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:38509:12)
    at _interpolate (file:///app/.yarn/__virtual__/vite-virtual-68526d8c1a/0/cache/vite-npm-5.0.11-d5457a8b86-74a3ddc6d4.zip/node_modules/vite/dist/...

Answer №1

After thorough investigation, I have identified the main cause of this issue: If you are using a devcontainer, ensure that you do not mistakenly declare a variable in your .env file with the same name as its assignment:

API_TOKEN=${API_TOKEN}

This oversight will result in an error only within the devcontainer environment, while it will function correctly locally.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Why am I encountering the 'nonexistent type' error in my Vue 3 project that uses Typescript and Vuelidate?

Seeking assistance with a Vue 3 and Vuelidate issue. I followed the configuration guide provided at . <script lang="ts"> import { required, minLength, maxLength, numeric } from '@vuelidate/validators' import useVuelidate from &apo ...

What is the best way to eliminate properties from multiple objects that are not undefined?

When attempting to remove properties from an object, it may throw an error if the property does not have a value. What is the correct method to delete similar properties from multiple objects? Main.js if (data.details.primary.transactionHistory !== undef ...

Transforming Uint8Array into BigInt using Javascript

I've come across 3 different ways to convert a Uint8Array to BigInt, but each method seems to produce varying results. Can someone clarify which approach is correct and recommended? Utilizing the bigint-conversion library. The function bigintConversi ...

Prevent the onclick function of a span element from being triggered when the user clicks on a dropdown menu contained within

Just delving into the world of web development and currently tackling a React project. Encountered an issue where I need to make a span element clickable. However, there's a dropdown within that span that doesn't have any onClick event attached t ...

Automatically Populate Cells in the Same Row of an Array Form in Angular 9 Reactive Form

Continuing my journey of learning Angular, I have encountered a roadblock once again and could really use some assistance. Situation I have a form that contains a table. The table has multiple cells but it all starts with the user selecting an option fr ...

The SpinButton object has an undefined public property called 'value' and the public method 'focus()' is not available

Recently, I've delved into using reactjs, typescript, and Office UI Fabric. However, I'm facing a challenge with one of the components from fabric. In this scenario, I have a simple Product component containing a SpinButton and a DefaultButton. M ...

Arrange the items that are missing from Array B to be located at the bottom of Array A, organized in a file tree structure

I have two arrays containing different types of objects. Each object in the arrays has a title assigned to it. My goal is to compare these two arrays based on their titles and move any files that are not included in the bottom part of the fileStructure arr ...

All authentication logic in Angular encapsulated within the service

I am considering moving all the business logic into the auth service and simply calling the method on the component side. Since none of my functions return anything, I wonder if it's okay or if they will hang. COMPONENT credentials: Credentials = ...

How can I get rid of the table borders and set colors for every other row in the

How can I remove the border lines from a table and assign colors to alternate rows in the table? Follow this link for the code: https://stackblitz.com/angular/kooxxyvddeqb?file=app%2Ftable-sticky-columns-example.css Thank you in advance ...

Obtaining gender information by utilizing checkboxes in Angular 7

I have developed an Angular application that enables users to filter samples by gender using checkboxes. The options include male, female, or both genders selected. Currently, the filtering works for selecting either male or female individually, as well as ...

Can a mandatory attribute be made non-essential within an intersection category?

Currently, I am customizing the Material UI date picker and exploring ways to make the required props optional since default values are already provided by the parent component. This is my current code: import React, { useState } from "react"; i ...

Installing and importing Angular Google Maps in an Angular 2 application using TypeScript: A step-by-step guide

Can you provide step-by-step instructions on integrating angular-google-maps into an Angular 2 application and importing it for use in a TypeScript component? ...

Typescript's Accessor decorator ensures that the decorated code is executed only once, fetching the previously calculated value for any subsequent calls

The topic discussed here originates from a previous discussion on a method decorator in Typescript. In some scenarios, there are `get` methods in a Typescript class that involve intensive computations. Some of these methods always return the same result an ...

Issue with Symbol Constructor in Typescript: [ts] The 'new' keyword can only be used with a void function

Just starting out with typescript and experimenting with the ES6 Symbol constructor. How can I address this ts lint problem without resorting to using any? const symbol = new Symbol(path); I'm trying to avoid doing this: const symbo ...

Tips for displaying text on the bubbles of a vector map using the DevExpress library in an Angular and TypeScript environment to showcase counts or other relevant information

I managed to incorporate the devextreme angular 2 map into my demo project. My goal is to display the count of individuals with the name 'x' on the bubble as a label/text on the vector map, without the need for hovering to see a tooltip. I want t ...

Execute a selector on child elements using cheerio

I am struggling to apply selectors to elements in cheerio (version 1.0.0-rc.3). Attempting to use find() results in an error. const xmlText = ` <table> <tr><td>Foo</td><td/></tr> <tr><td>1,2,3</td> ...

Asserting within a specific condition's scope in TypeScript

I am facing a similar situation, type Field1Type = { a: string; } type Field2Type = { b: string; c: number; } type ObjType = { field: Field1Type | Field2Type } const field = { b: "" c: 0 } const obj = { field } as ObjType i ...

Is there a way for me to retrieve the header values of a table when I click on a cell?

I have a project where I am developing an application for booking rooms using Angular 2. One of the requirements is to be able to select a cell in a table and retrieve the values of the vertical and horizontal headers, such as "Room 1" and "9:00". The data ...

The value returned by the .then() function in Angular Promises

function performHTTPRequest(){ return new Promise((resolve, reject) => { this.http.get(this.url).subscribe(data => { resolve(data) }, error => { reject(error); }, ); }); } runAfte ...

When utilizing Angular 2, this message is triggered when a function is invoked from the Observable

One of my services is set up like this: @Injectable() export class DataService { constructor(protected url: string) { } private handleError(error: Response) { console.log(this.url); return Observable.throw(new AppError(error)); ...