Amphtml: Uncaught ReferenceError: module$build_system$global_configs$caches_json is not defined

Created on 12 May 2020  路  3Comments  路  Source: ampproject/amphtml

amp-story-player is throwing the following error:

Uncaught ReferenceError: module$build_system$global_configs$caches_json is not defined

Causing the player to stop loading.

This is because in #27658 we import the caches.json found in build-system/, but it looks like it's not bundled in production.

/cc @ampproject/wg-stories

High Priority Bug

Most helpful comment

My inclination is that this should be a compilation/build-time failure rather than a presubmit check. Ideally it would fail as soon as a developer tried to build locally

All 3 comments

Importing @jridgewell's recent comment here for visibility and discussion https://github.com/ampproject/amphtml/pull/27658/files#r424018799

"Importing from build-system isn't supported, because isn't not included as one of our files when we pass them to closure."

@ampproject/wg-infra can we add a pre-submit check to prevent importing from build-system/? Is that something that could've prevented this? Is there any action (e.g. sanity check) I could've taken to prevent this issue from slipping through?

My inclination is that this should be a compilation/build-time failure rather than a presubmit check. Ideally it would fail as soon as a developer tried to build locally

Discussed with @jridgewell offline, he came up with a fix (#28366) to the existing regex that checks for unknown dependencies. He thinks Closure possibly changed the import identifier format.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

choumx picture choumx  路  3Comments

radiovisual picture radiovisual  路  3Comments

cvializ picture cvializ  路  3Comments

westonruter picture westonruter  路  3Comments

edhollinghurst picture edhollinghurst  路  3Comments