angular-cli: No matching export in "node_modules/@angular/common/fesm2022/http.mjs" for import "HttpStatusCode"

Which @angular/* package(s) are the source of the bug?

common

Is this a regression?

Yes

Description

No matching export in “node_modules/@angular/common/fesm2022/http.mjs” for import “HttpStatusCode”

src/app/core/services/interceptors/api-token.interceptor.ts:1:23:
  1 │ import { HttpResponse, HttpStatusCode, } from '@angular/common/http';

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular: 16.0.4
"builder": "@angular-devkit/build-angular:browser-esbuild",

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 28 (8 by maintainers)

Most upvoted comments

update: i upgraded to version 16.1.0 and it kind of fix the issues - but started another weird issue: lets say i have:

import { IVariable, MultiSelectSelectionType, MultiSelectVariableSourceType } from '@app/features/dashboard/model/variable.model'; i got error thatIVariable is not exported or something, while it is: export interface IVariable { ...} the solution was to import it alone: import { IVariable } from '@app/features/dashboard/model/variable.model';

after that, it compiled successfully, but got error in the browser: Uncaught SyntaxError: The requested module '/.angular/cache/16.1.0/vite/deps/@angular_core.js?v=091cc3f7' does not provide an export named 'SimpleChanges' (at alerts-monitoring-filters.component.ts:11:3) it try to find SimpleChanges from the cache of core, but its not there. removing the cache and rebuild didnt help

im lost what to do here… any idea?

@JeanMeche, it happens when there is "optimization": false in build section.