When attempting to run the yarn build dist command, an error of type TypeError is encountered, stating that it is not possible to set the constructor property

Upon executing the following command in a GitHub workflow, I encountered this error: npm-run-all -p types transpile

@internal_package: $ swc src --out-dir dist
@internal_package: /home/runner/work/repo-name/repo-name/node_modules/ttypescript/lib/loadTypescript.js:13
@internal_package:         function __() { this.constructor = d; }
@internal_package:                                          ^
@internal_package: TypeError: Cannot set property constructor of [object Object] which has only a getter
@internal_package:     at new __ (/home/runner/work/repo-name/repo-name/node_modules/ttypescript/lib/loadTypescript.js:13:42)
@internal_package:     at __extends (/home/runner/work/repo-name/repo-name/node_modules/ttypescript/lib/loadTypescript.js:14:84)
@internal_package:     at /home/runner/work/repo-name/repo-name/node_modules/ttypescript/lib/loadTypescript.js:65:5
@internal_package:     at Object.<anonymous> (/home/runner/work/repo-name/repo-name/node_modules/ttypescript/lib/loadTypescript.js:100:2)
@internal_package:     at Module._compile (node:internal/modules/cjs/loader:1256:14)
@internal_package:     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
@internal_package:     at Module.load (node:internal/modules/cjs/loader:1119:32)
@internal_package:     at Module._load (node:internal/modules/cjs/loader:960:12)
@internal_package:     at Module.require (node:internal/modules/cjs/loader:1143:19)
@internal_package:     at require (node:internal/modules/cjs/helpers:121:18)
@internal_package: Node.js v18.17.1

I attempted to update the node version to 18

Answer №1

The issue was resolved by updating the ttypescript version from 1.5.13 to 1.5.15

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

React Native Issue: Missing propType for native property RCTView.maxHeight

Upon upgrading to RN 0.30, I encountered the error message below even when trying to build the most basic app: react-native init AwesomeProject react-native run-ios What's peculiar is that the warnings include components BlurView, VibrancyView, an ...

Convert expressApp.ts to use the require method in Node.js

I need assistance in converting the "import" statements to node-friendly "require" in the code below. For example: import * as express from 'express'; should become const express = require('express'); I am facing an issue with the lin ...

Constructing Electron Native Extensions with Visual Basic 2015

My Current Progress: Currently, I am in the process of developing a NodeJS native extension that I plan to integrate with Electron. However, based on my previous experiences, I have come to realize that the build process for just NodeJS involves including ...

Setting up Cypress's Electron browser for managing downloads

Is it possible to modify the Electron browser's configuration from within Cypress, in order to fix issues like download prompts not being detected? There is an issue with Cypress where it cannot detect download prompts, but there seems to be a potent ...

Discover the troubleshooting steps for a Telegram bot within VS Code using Node.js

I am currently troubleshooting a code that utilizes the telegram bot-api in Node.js. Everything is running smoothly until it reaches this particular line: console.log('test') After printing "test", the code ceases to execute further. The strang ...

What is the URL I need to visit in my browser to monitor updates while running npm?

I am interested in utilizing npm to monitor any changes made in my project and immediately view them in my browser. Essentially, I have been implementing npm using this modified code snippet from this source, which allows me to run the command npm run buil ...

Pictures failing to load in the MongoDB collection

I am facing an issue with uploading a form that includes an image to my mongodb database. While all the data is being stored correctly, the images are not visible in the database. I suspect this might be related to the error message 'typeError cannot ...

Encountering issues with connecting to a socket.io room and facing error messages during the

Having trouble with socketIO communication. First issue is the inability to communicate with another room. Unable to identify the problem. Second issue is receiving the following message: index.js:83 WebSocket connection to 'ws://localhost:3000/ ...

There is no 'Access-Control-Allow-Origin' header found on the requested resource while utilizing AWS API Gateway in conjunction with AWS Lambda

Working on my backend, I have integrated AWS API gateway with AWS Lambda. I made sure to enable cors for my endpoint. However, upon testing the endpoint on the browser, I encountered the following error: No 'Access-Control-Allow-Origin' header ...

Poorly packaged library - Custom Angular library - Node Package Manager

Recently, I've been delving into the process of publishing a simple Angular library on NPM. Despite following various tutorials (like those found here, here, and here), I faced difficulties when attempting to use it in a test project. MY JOURNEY In s ...

Remove several lines from the standard output

I need help with a Node.js code snippet that writes multiple lines to the console and then clears only those specific lines. process.stdout.write(['a', 'b', 'c'].join('\n')) setInterval(() => { process.s ...

What specific event do I require for the onChange event in React using TypeScript?

I'm facing a problem while working with React TypeScript. I need to type the onChange event for a select element, but the data is coming from event.value instead of event.target.value. What should be the appropriate event to use in this case? Below i ...

In NextJS 12, an UnhandledPromiseRejectionWarning occurs when trying to reference the TextEncoder which is not defined

Currently, I am working on developing a Spotify clone using NextJS 12 along with a Tailwind CSS template. To initiate the project, I executed the following command: npx create-next-app -e with-tailwindcss spotify-2. The project was successfully created, b ...

Utilize the version designated in the package.json file for your NPM script

Currently, I am working on an npm script that involves starting up a server and building to a specific directory in my project. Within this directory, there is a sub-directory that matches the version of my app specified in the package.json file. { name: ...

Oops! Looks like there was an issue with defining Angular in AngularJS

I am encountering issues while attempting to launch my Angular application. When using npm install, I encountered the following error: ReferenceError: angular is not defined at Object.<anonymous> (C:\Users\GrupoBECM18\Documents&bs ...

Unable to find the 'ipfs-http-client' module in the React application

I have encountered an issue with the ipfs-http-client package in my React application. Currently, I am utilizing node 16.14.0 https://i.stack.imgur.com/IDToH.png The specific error message is: https://i.stack.imgur.com/59swB.png Even when I Ctrl + Clic ...

Display a nested component post initialization in Angular

<ng-container *ngIf="isTrue; else notTrue"> <app-child [property1]="value" [property2]="value" [property3]="value" (function1)="func($event)" ></app-child> </ng-container> <ng-t ...

The Access-Control-Allow-Origin error is preventing the Angularjs post request from going through

I am encountering an issue with my index.html file that is sending a post request to localhost:3000/SetUser. The error I keep receiving states XMLHttpRequest cannot load https://localhost:3000/SetUser. No 'Access-Control-Allow-Origin' header is p ...

Definition duplication is necessary for TypeScript object properties

I'm currently facing a challenge with TypeScript as I attempt to develop a function that properly assigns default values for an optional object within another object. Even though I am setting up everything in the parameters, I keep encountering an er ...

Creating an object using a string in node.js

I have a string that I am sending from AngularJS to NodeJS in the following format. "{↵obj:{↵one:string,↵two:integer↵}↵}" //request object from browser console To convert this string into an object and access its properties, I am using the serv ...