Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vite file analysis for static assets fails after update #30798

Open
@alsami

Description

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

20.1.1

Description

I am using firebase for authentication. Since I am not hosting the application on the firebase domain, certain steps for self-hosting the auth files to allow redirect sign-in are required. (See readme link of repro, these changes were required because of the third-party cookie blocking introduced by browsers)

For that I downloaded the auth files and placed them as described and defined them as static assets. Now after updating the CLI and Angular deps, vite throws the error when opening the page:

12:18:24 PM [vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.

Minimal Reproduction

I created a repository here with readme file that describes the manual steps for you to make since I cannot put my secrets in there.

Should be pretty simple if I can assist please let me know.

Exception or Error

12:18:24 PM [vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
 Plugin: vite:import-analysis
 File: /home/sami/Dev/alsami/my-gym-pal/src/__/auth/iframe:6:56
 4 | <meta name=viewport content="width=device-width, initial-scale=1">
 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 6 | <script type="text/javascript" src="iframe.js"></script>
 | ^
 7 | <script type="text/javascript" nonce="firebase-auth-helper">
 8 | fireauth.iframe.AuthRelay.initialize();
 at TransformPluginContext._formatLog (file:///home/sami/Dev/alsami/my-gym-pal/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:31460:43)
 at TransformPluginContext.error (file:///home/sami/Dev/alsami/my-gym-pal/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:31457:14)
 at TransformPluginContext.transform (file:///home/sami/Dev/alsami/my-gym-pal/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:29962:10)
 at async EnvironmentPluginContainer.transform (file:///home/sami/Dev/alsami/my-gym-pal/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:31274:14)
 at async loadAndTransform (file:///home/sami/Dev/alsami/my-gym-pal/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:26451:26)

Your Environment

_ _ ____ _ ___
 / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
 / しろさんかく \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
 / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
 /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
 |___/
 
Angular CLI: 20.1.3
Node: 24.0.0
Package Manager: npm 11.3.0
OS: linux x64
Angular: 20.1.3
... build, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.2001.3
@angular-devkit/core 20.1.3
@angular-devkit/schematics 20.1.3
@angular/fire 20.0.1
@schematics/angular 20.1.3
rxjs 7.8.2
typescript 5.8.3
zone.js 0.15.1

Anything else relevant?

I tried many things, like searching for a way to modify the vite configuration to ignore these files which apparently is currently not supported by the angular-cli.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /