Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--live-reload=false results in error: The requested module '/@vite/client' does not provide an export named 'injectQuery' #29556

Open
lukas-shawford opened this issue Jan 31, 2025 · 1 comment · May be fixed by #29570

Comments

@lukas-shawford
Copy link

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

Don't known / other

Is this a regression?

Yes

Description

When certain third-party dependencies are used in conjunction with --live-reload=false, the application fails to load in Angular v19:

Uncaught SyntaxError: The requested module '/@vite/client' does not provide an export named 'injectQuery' (at chunk-QRJ2NFPW.js?v=4363c128:1:10)

Removing --live-reload=false from the ng serve command results in the application working again. It also worked in Angular v18 (with --live-reload=false).

I have found this issue with the @arcgis/core dependency.

To replicate:

npm i @arcgis/core

Then in app.component.ts or main.ts, add an import for a file from the library (add a console.log to prevent dependency from being optimized away):

import FeatureLayer from '@arcgis/core/layers/FeatureLayer'

console.log(FeatureLayer)

Then run the app using:

ng serve --live-reload=false --host=127.0.0.1

Repro of this issue with @arcgis/core is available here:

https://stackblitz.com/edit/stackblitz-starters-vmdnvkkn?file=src%2Fmain.ts

Another user reported this error with the pdf.js library on this StackOverflow thread:

https://stackoverflow.com/questions/79391578/angular-19-and-vite-throwing-error-about-named-export-injectquery

StackBlitz demo for the pdfjs dependency (from above thread):

https://stackblitz.com/edit/node-c5u2pyx6?file=package.json

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-vmdnvkkn?file=src%2Fmain.ts

Please provide the exception or error you saw

Uncaught SyntaxError: The requested module '/@vite/client' does not provide an export named 'injectQuery' (at chunk-QMHRUMYA.js:1:10)

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

Angular CLI: 19.1.5
Node: 22.13.1
Package Manager: npm 10.9.2
OS: win32 x64

Angular: 19.1.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.5
@angular-devkit/build-angular   19.1.5
@angular-devkit/core            19.1.5
@angular-devkit/schematics      19.1.5
@angular/cli                    19.1.5
@schematics/angular             19.1.5
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else?

Inspecting @vite/client file via dev tools shows that it is empty:

Image

@alan-agius4 alan-agius4 transferred this issue from angular/angular Feb 1, 2025
@Francesco-Borzi
Copy link

I'm getting the same error after upgrading my app from Angular 18 to Angular 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants