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

The bamboo construction falters as webpack is unable to locate the node_modules

After setting up my Angular project with webpack in version 1.7, everything runs smoothly locally when I execute the npm run build task to launch webpack. However, I encountered an issue when trying to set up a plan for continuous integration using bamboo ...

Error during compilation in npm (symbol '_' is not recognized)

After updating all the dependencies in my JavaScript program without making any changes to my components, I encountered an error when running: npm run build The error specifically mentions a problem with one of my components: Failed to compile. ./src/c ...

Updating dynamically rendered component content with ngComponentOutlet in Angular 11: A comprehensive guide

I am working on an Angular 11 app that includes a menu generated from an array of objects with specific properties: { icon: CUSTOMER_ORDER_PROPERTIES.icon, iconColor: CUSTOMER_ORDER_PROPERTIES.color, label: 'Search Customer Order', routeB ...

What sort of data type does this belong to?

I am trying to figure out the data type of this code snippet in order to decode it using PHP: {s:31:"xperience_achievements_you_have";s:20:"You have %1$s points";s:26:"xperience_award_drawnin_of";s:69:"<b>%1$s</b> drawn-in of <a href="membe ...

Encountering difficulties installing and executing my personal npm package on a Linux system

I have developed an npm module that I plan to release, but before doing so, I want to ensure it functions correctly. After installing the module with npm install -g ., everything runs smoothly on my Windows machine. However, when trying to execute it on my ...

Receiving an `Invalid module name in augmentation` error is a common issue when using the DefaultTheme in Material

After following the guidelines outlined in the migration documentation (v4 to v5), I have implemented the changes in my theme: import { createTheme, Theme } from '@mui/material/styles' import { grey } from '@mui/material/colors' declar ...

Get a specific key's value from a JSON response retrieved using a GET request to a URL

Recently, I developed an API for retrieving geolocation data. The API endpoint is URL http://geoip.mediaciptainformasi.co.id/ip.php?ip=1.1.1.1, which returns a JSON response containing various information: { "ip_address": "1.1.1.1", "Jumlah Akses per hari ...

Angular observable will only receive data once during initialization

Currently, I am progressing through Moshs' Angular course where we are building a simple shopping page. Despite the tutorial being a bit outdated, I managed to adapt to the changes in bootstrap and angular quite well until I reached the shopping cart ...

How to customize Material UI Autocomplete options background color

Is there a way to change the background color of the dropdown options in my Material UI Autocomplete component? I've checked out some resources, but they only explain how to use the renderOption prop to modify the option text itself, resulting in a a ...

Angular 16 routing not loading content

I configured the routes in Angular v16 and encountered a blank page issue with the login and register functionality. I suspect it has to do with routing, but after checking multiple times, I couldn't pinpoint the exact problem. Below are snippets of t ...

Error message: `Socket.io-client - Invalid TypeError: Expected a function for socket_io_client_1.default`

I have successfully installed socket.io-client in my Angular 5.2 application, but after trying to connect (which has worked flawlessly in the past), I am encountering a strange error. TypeError: socket_io_client_1.default is not a function at new Auth ...

Encountering a 403 Error when attempting to run `npm install` on Ubuntu within Windows 10

Currently, I am utilizing Ubuntu on Windows 10 to install and run npm. To begin, I downloaded nodejs by executing the following commands: curl -sL https://deb.nodesource.com/setup_10.x | bash apt-get install -yq nodejs Subsequently, I configured my prox ...

Leverage Angular2 components within Angular4 framework

Would it be possible to utilize angular2 components in angular4 projects? Specifically, I am interested in using a chart generation library from . However, it seems that the dependencies of this library are not compatible with my application. Are angular2 ...

Can you please tell me the location of the sqlite database file in Ionic 2 Cordova?

Currently, I am working with cordova-plugin-sqlite within the context of angular2 ionic2. Interestingly, despite my efforts, I have not been able to locate the database file anywhere within my project structure. Numerous attempts to resolve this issue by ...

What is the method for determining the required or imported base path?

My package.json includes the main option to set the default file for importing like import 'my-index' from 'my-module' However, I would like to break up my-module into separate files so developers can include them individually with sta ...

Error is being returned by the JSONP callback

Looking to grasp JSONP. Based on my online research, I've gathered that it involves invoking a function with a callback. Other than that, is the way data is handled and the data format similar to JSON? I'm experimenting with JSONP as shown below ...

How to include a new key into a nested dictionary using Python with Flask

Currently, I am in the process of creating a dictionary containing a list of IDs that will serve as the response from an API. This dictionary is crucial for generating a JSON response. I am attempting to add a list of affected IDs resulting from the reque ...

Challenges encountered while compiling Node.js code with ts-node (Error: Cannot use import statement outside a module)

Trying to compile TypeScript code with NodeJS using this command: npx ts-node src/server.ts An error is thrown: SyntaxError: Cannot use import statement outside a module Following the error's instructions: Warning: To load an ES module, set " ...

Is my JSON data causing the error of invalid React child components?

Although this question has been asked multiple times on Stack Overflow, the solutions provided have not worked for me. My main goal is to retrieve notifications from a JSON file located here: I suspect that my JSON file may be poorly structured, especial ...

Failure to access Downloads file on MacOS: Watchman issue

I'm currently facing an issue while coding my Expo app. When I run "npm start," I receive the following error message: Error: std::__1::system_error: open: [filepath to project]: Operation not permitted Everything was running smoothly until I accide ...