Skip to content

[BUG] Altair v8.0.4 fails to load in browser - ES module imports in main.js #2924

@n1kl4s

Description

@n1kl4s

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Since the release of v8.0.4 (3 days ago), Altair fails to start when loaded via the jsdelivr CDN. The application only displays a white background with the Altair logo. The browser console shows the following errors:

main.js:3 Uncaught SyntaxError: Cannot use import statement outside a module
polyfills.js:3 Uncaught ReferenceError: AltairGraphQL is not defined
(anonymous)    @    ui:68
invokeTask    @    polyfills.js:3
runTask    @    polyfills.js:3
invokeTask    @    polyfills.js:3
W    @    polyfills.js:3
Y    @    polyfills.js:3
ee    @    polyfills.js:3

Screenshot prove:
Image

Root Cause Analysis

A brief analysis of the compiled main.js reveals that ES module imports are now present in the build output (e.g., import {...} from '...';), which was not the case in previous versions. Example from current main.js:

// build from path: /altair-static/build/dist/main.js

!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ea87f22c-f7c8-5768-a152-bc1dea1d49ab")}catch(e){}}();
import{a as Hie,b as jie,c as $ie,d as qie,e as Uie,f as Qie,g as Wie,h as Yie,j as Gie,k as Kie} from"./chunk-RU5GXIYR.js";
import{a as WP,b as Zie}from"./chunk-3MPON6KA.js";
import{a as lPe,b as cPe,c as uPe}from"./chunk-FWMULOCB.js";
// ... more imports

These ES module imports cannot be executed directly by browsers without proper module type declarations in the script tags, causing most likely the application to fail to initialize.

Expected Behavior

Altair should load and function correctly when served from the jsdelivr CDN, as it did in versions prior to v8.0.4.

Steps To Reproduce

  1. Integrate Altair using the dotnet-graphql integration (which uses the latest version from jsdelivr CDN)
  2. Load the application in a browser
  3. Observe that only the Altair logo appears on a white background
  4. Open browser console to see the module import errors

Environment

* OS: Debian Bookworm (12)
* Browsers tested: Chrome, Edge, Firefox (all affected)
* Platform: dotnet-graphql integration / jsdelivr CDN
* Version: v8.0.4
* CDN URL: (jsdelivr CDN - latest: https://cdn.jsdelivr.net/npm/altair-static/build/dist/main.js)

Additional context

There is currently no rollback option available to temporarily use the previous working version. This is a breaking change that affects all users relying on the CDN distribution of Altair.

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