MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Regression: Javascript Builds / Runtime Fails (on Windows)

Open kwokcb opened this issue 9 months ago • 1 comments

Issue

On Windows all tests seem to fail for the Javascript build.

Tests

These are the noticeable regressions. This was working with 1.39.3 but no longer works with main / 1.39.4 so assuming this is a recent change.

Example:

  1) Code Examples
       Building a MaterialX Document:
     TypeError: fetch failed
      at node:internal/deps/undici/undici:13484:13
     Caused by: Error: unknown scheme
      at makeNetworkError (node:internal/deps/undici/undici:9251:35)
      at schemeFetch (node:internal/deps/undici/undici:10654:34)
      at node:internal/deps/undici/undici:10496:26
      at mainFetch (node:internal/deps/undici/undici:10515:11)
      at fetching (node:internal/deps/undici/undici:10463:7)
      at fetch (node:internal/deps/undici/undici:10332:20)
      at fetch (node:internal/deps/undici/undici:13482:10)
      at fetch (node:internal/bootstrap/web/exposed-window-or-worker:75:12)
      at instantiateAsync (_build\/JsMaterialXCore.js:9:12376)
      at createWasm (_build\/JsMaterialXCore.js:9:12986)
      at d:\Work\materialx\bernard_MaterialX_3\javascript\MaterialXTest\_build\/JsMaterialXCore.js:9:130072
      at Context.<anonymous> (/codeExamples.spec.js:9:32)
      at Generator.next (<anonymous>)
      at asyncGeneratorStep (/codeExamples.spec.js:3:48)
      at _next (/codeExamples.spec.js:3:48)
      at d:\Work\materialx\bernard_MaterialX_3\javascript\MaterialXTest\/codeExamples.spec.js:3:48
      at new Promise (<anonymous>)
      at Context.<anonymous> (/codeExamples.spec.js:3:48)
      at processImmediate (node:internal/timers:491:21)

The viewer seems to build and run. However using the downloaded libraries ESSLShaderGenerator cannot be initialized which means nothing else can continue.

{ "name": "BindingError", "message": "EsslShaderGenerator has no accessible constructor", "stack": "BindingError: EsslShaderGenerator has no accessible constructor\n at BindingError. (http://localhost:8000//javascript/shader_utilities/dist/JsMaterialXGenShader.js:9:109070)\n at new BindingError (eval at createNamedFunction (http://localhost:8000//javascript/shader_utilities/dist/JsMaterialXGenShader.js:9:108779), :4:34)\n at EsslShaderGenerator. (http://localhost:8000//javascript/shader_utilities/dist/JsMaterialXGenShader.js:9:129425)\n at new EsslShaderGenerator (eval at createNamedFunction (http://localhost:8000//javascript/shader_utilities/dist/JsMaterialXGenShader.js:9:108779), :4:34)\n at Viewer.initialize (webpack://MaterialX-Shading-Utilities/./source/viewer.js?:1619:26)\n at eval (webpack://MaterialX-Shading-Utilities/./source/renderer.js?:294:22)" }

kwokcb avatar May 04 '25 16:05 kwokcb

Note: Unit test was with a local build. Runtime was downloaded from CI. e.g. sha256:15d2f881a380992512ce6138f8136caee4b27c031600492a382f63997e3c1432 in https://github.com/kwokcb/MaterialX/actions/runs/14821582878.

@ld-kerley , I'm not sure if it's you latest changes for the build. Seems there are now export problems for the latter. I think the former was what we saw in our side chat ?

kwokcb avatar May 04 '25 16:05 kwokcb