Error: export 'ɵivyEnabled' (imported as 'ɵivyEnabled') was not found in '@angular/core'
Asked Answered
C

3

7

I've created a new Angular app (v15.2.0) and I've added @ngxs/store (v3.7.6) A detailed package.lock can be seen here

{
  ...
  "dependencies": {
    "@angular/animations": "^15.2.0",
    "@angular/common": "^15.2.0",
    "@angular/compiler": "^15.2.0",
    "@angular/core": "^15.2.0",
    "@angular/forms": "^15.2.0",
    "@angular/platform-browser": "^15.2.0",
    "@angular/platform-browser-dynamic": "^15.2.0",
    "@angular/router": "^15.2.0",
    "@ng-bootstrap/ng-bootstrap": "^14.0.1",
    "@ngxs/store": "^3.7.6", <-- added by me
    "ngx-cookie-service": "^15.0.0", <-- added by me
    "font-awesome": "^4.7.0", <-- added by me
    "bootstrap": "^5.2.3", <-- added by me
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.12.0"
  },
  "devDependencies": { <-- all ar the default ones
    "@angular-devkit/build-angular": "^15.2.1",
    "@angular/cli": "~15.2.1",
    "@angular/compiler-cli": "^15.2.0",
    "@types/jasmine": "~4.3.0",
    "jasmine-core": "~4.5.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~4.9.4"
  }
}

npm i runs fine:

$ npm i
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs

added 912 packages, and audited 913 packages in 34s

94 packages are looking for funding
  run 'npm fund' for details

found 0 vulnerabilities

But when i do a npm start, i get this:

$ npm start
...

./node_modules/@ngxs/store/__ivy_ngcc__/fesm2015/ngxs-store.js:2667:6-17 - Error: export 'ɵivyEnabled' (imported as 'ɵivyEnabled') was not found in '@angular/core' (possible exports: ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODUL
E_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, Compil
i18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery)


× Failed to compile.

How can i fix this error with ngxs? Without it everything works fine, but I need ngxs in my application. I have another angular app that has the same dependencies but uses angular v14. Any ideas?

Downgraded angular from v15 to v14 and it worked, but I have to use Angular 15

Cainozoic answered 18/3, 2023 at 0:0 Comment(0)
U
0

try angular 15.0.2 working fine for me and you can use angular 15

Utah answered 19/3, 2023 at 0:39 Comment(1)
did a clean install of angular, installed 15.0.2 and it worked. thanks!Cainozoic
Z
4

This was actually fixed in the latest release 3.8.0 Try to update to this version and reinstall again, now ngxs have ivy package support.

https://github.com/ngxs/store/compare/v3.7.6...v3.8.0

Zymogenic answered 31/3, 2023 at 9:50 Comment(1)
First of all, I have uninstalled the ngxs(v3.7) and installed ngxs/[email protected]. And then updated @angular/core and @angular/cli to the last version(15.2.7). My project works without any errorMcauley
J
1

Having the same problem. For me it works with new dev versions of ngxs (i.e. 3.7.6-dev.master-94b06c2).

Juvenal answered 18/3, 2023 at 8:49 Comment(1)
unfortunately, that did not solve my problemCainozoic
U
0

try angular 15.0.2 working fine for me and you can use angular 15

Utah answered 19/3, 2023 at 0:39 Comment(1)
did a clean install of angular, installed 15.0.2 and it worked. thanks!Cainozoic

© 2022 - 2024 — McMap. All rights reserved.