The function 'makeDecorator' does not support function calls when being accessed

Resolved by @alexzuza. Check out his solution below - major props! The issue was with the node_modules folder in the ng2-opd-popup directory, it needed to be removed and the src/tsconfig.app.json file had to be adjusted accordingly. Make sure to also refer to the comments for instructions on setting up rimraf to automatically exclude the node_modules folder during npm install.

This is the error message I encountered:

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function

The suggested fix can be found here, but unfortunately it didn't work for me since my Angular version is 4.3.

package.json:

PopupModule.forRoot(),

tsconfig.json:

"paths": {
  "@angular/*": ["node_modules/@angular/*"]
},

tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "paths": {
      "@angular/common": ["../node_modules/@angular/common"],
      "@angular/compiler": ["../node_modules/@angular/compiler"],
      "@angular/core": ["../node_modules/@angular/core"],
      "@angular/forms": ["../node_modules/@angular/forms"],
      "@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
      "@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"],
      "@angular/router": ["../node_modules/@angular/router"],
      "@angular/http": ["../node_modules/@angular/http"]
    },
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

tsconfig.app.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "paths": {
      "@angular/*": ["../node_modules/@angular/*"]
    },
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

File structure snapshot: https://i.stack.imgur.com/IKsL7.png

The package causing issues: ng2-opd-popup

If anyone has a workaround for this problem or knows of a better alternative package to suggest, please let me know!

Answer №1

Modify the src/tsconfig.app.json file as follows:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": [],
    "paths": {
      "@angular/*": ["../node_modules/@angular/*"] <=== include this
    }
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}

Remember to use .. for the baseUrl since it points to the src folder.

https://github.com/alexzuza/angular-cli-make-decorator-fix

This adjustment should work for aot compilation, but in jit mode, make sure to delete the

node_modules/ng2-opd-popup/node_modules
folder.

https://i.stack.imgur.com/Lyo1W.png

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

Extract data from XML CLOB field

Hello there, I am facing an issue with SQL. I have a table with a data type CLOB where a CLOB is stored. In the same table, if we have XML format, we use a function to extract the XML field. CREATE OR REPLACE FUNCTION gettagvalue ( XMLBody IN CLOB, TagXml ...

There was a problem encountered while trying to load the .json/.csv file

Attempting to grasp D3 through this video has been a challenging experience, particularly when attempting to load an external file. The code snippets are provided below: index.html <html> <head> <meta charset="utf-8"> <title& ...

The compatibility issue between Tailwind CSS and Material UI has been identified in the latest version of Next, version 14.0

Currently, I am working with Next 14.0.2 alongside Material UI and Tailwind CSS for my Frontend development tasks. However, I've run into some challenges regarding styling components. One specific issue I faced was when setting a button to navigate to ...

Transferring information between pages within Next.js 13

I am currently working on a form that is meant to generate a Card using the information inputted into the form, which will then be displayed. While I have successfully implemented the printing feature, I am having difficulty transferring the form data to t ...

Encountered a problem while trying to set up the Angular Material Library that has been cloned from

Trying to setup a library that has been forked from https://github.com/angular/material2. git clone <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="63040a1723040a170b16014d000c0e">[email protected]</a>:vugar005/m ...

"Trouble with Typescript's 'keyof' not recognizing 'any' as a constraint

These are the current definitions I have on hand: interface Action<T extends string, P> { type: T; payload: P; } type ActionDefinitions = { setNumber: number; setString: string; } type ActionCreator<A extends keyof ActionDefinitions> ...

Currently trapped within the confines of a Next.js 13 application directory, grappling with the implementation of a

I need to figure out how to export a variable from one component to layout.tsx in such a way that it is not exported as a function, which is currently causing the conditional check in the class name to always be true. Below is the code snippet: // File w ...

What is the process for adding an element using Angular Material2 design?

I am in the process of creating a template where, upon clicking a button, I want to append specific elements. While I have successfully appended the elements using the code below, I am facing challenges with adding styles and integrating angular-material2 ...

Typescript Regular Expression Issue: filter function is not returning any matches

Currently, I am developing an Ecommerce API and working on a class specifically for search queries. My approach involves using regex and typescript with node.js. Although I have based my project on a JavaScript node project, I am encountering an issue wher ...

The attempt to decode the string from POST using json_decode failed due to a hang-up in

I'm currently learning about PHP, JSON, and JavaScript. I am facing an issue with using the json_decode function in PHP after receiving a JSON string from JavaScript. I am able to save the JSON string to a file without any problem, but when I try to ...

Deploying an Angular application on Heroku platform

Recently, I followed this helpful guide to deploy my app: Angular CLI Deployment: Host Your Angular 2 App on Heroku However, today when attempting to deploy another app, the build was successful but the ng build did not run or execute as expected. D ...

After the transition to Angular 8, the functionality of testing with Jest seems to have

After upgrading our Angular version from 7 to 8, we encountered some issues when using Jest as our test runner. Our main objective now is to ensure that our build pipeline runs smoothly with our JavaScript tests. One error message we're facing is: An ...

Issue in Android Studio: The element value must be a constant expression

I have encountered an issue while trying to assign a value to @GET. When I directly input a value, my API call works fine. However, if I attempt to retrieve the value from another class, I receive an error stating that the element value must be a constant ...

I encountered TS2345 error: The argument type X cannot be assigned to the parameter type Y

Currently, I am delving into the world of Angular 8 as a beginner with this framework. In my attempt to design a new user interface with additional elements, I encountered an unexpected linting error after smoothly adding the first two fields. The error m ...

Limit the outcomes of the Ionic timepicker

Currently, I am utilizing the ionic datetime feature. However, instead of receiving just the hours, minutes, and seconds, the result I am getting looks like this 2020-10-05T00:00:27.634+07:00. What I actually require from this output is only 00:00:27. Is ...

What is the best way to simulate updating an object within an array for unit testing in Angular?

Currently, I am in the process of testing my Redux reducers. So far, I have successfully tested the GET and CREATE functionalities but I'm facing a challenge with implementing the UPDATE functionality. I am unsure how to mock it effectively. Below, yo ...

Insert items into an array at a specific index in typescript

Using the map function, I am adding elements to array arr1. Is there a way to specify the starting index position in typescript? For example: If I want to add elements from the 3rd index position of the array, with the first two indices holding a value of ...

Can Angular 2 Material Tabs be dynamically filled with a For Loop subscription?

Is it possible to populate a dynamic number of tabs on an Angular 2 website using a For Loop that subscribes to data from a database service? My dataset is categorized by Classes A, B, and C, each with Sub-Classes 1 and 2. I want to dynamically create thr ...

Encountering the issue "args.includes is not a function" in Node.js

My node version is v4.4.4 and npm version is 5.1.0 I encountered an error message: "args.includes is not a function node js. This is probably not a problem with npm." Could someone please assist me in resolving this issue? Below is a snippet of the code ...

Converting a uint array to a string in UTF-8 using Ionic

Currently utilizing Ionic 3 uintToString(uintArray) { var encodedString = String.fromCharCode.apply(null, uintArray), decodedString = decodeURIComponent(escape(encodedString)); return decodedString; It performs efficiently on the ionic serve comman ...