Skip to content

locateFile not used when loading SIDE_MODULES #14502

@bdenhollander

Description

@bdenhollander

Experimenting with locateFile for browser cache invalidation and noticed that SIDE_MODULES specified as Module['dynamicLibraries'] = ['a.wasm', 'b.wasm'] do not pass through locateFile . The HTTP requests are missing ?v=revision. HTTP requests for app.wasm and app.data have the revision string appended as expected.

Module['locateFile'] = function (path, prefix) {
  if (path.endsWith('.wasm') || path.endsWith('.data')) {
    return prefix + path + '?v=' + window.REVISION;
  }
  return prefix + path;
}

Noticed in 2.0.16 and confirmed that it also occurs in 2.0.20. I attempted to test later versions but some of the recent compiler/linker flag changes are preventing the project from compiling.

Is locateFile an appropriate tool? Is this a bug in the loading of SIDE_MODULES?

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