Can I offline runthe example html?

I can run all examples of the html in doc folder by using vscode. But I wish offline to directly run the /examples/webgl_loader_mmd.html, but the chrome console appears some error as below:
Can I solve this problem?

webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/build/three.module.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:45
GET file:///C:/WorkSpace/three.js-dev/build/three.module.js net::ERR_FAILED
webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/examples/jsm/libs/stats.module.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:47
GET file:///C:/WorkSpace/three.js-dev/examples/jsm/libs/stats.module.js net::ERR_FAILED
webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/examples/jsm/libs/lil-gui.module.min.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:48
GET file:///C:/WorkSpace/three.js-dev/examples/jsm/libs/lil-gui.module.min.js net::ERR_FAILED
webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/examples/jsm/controls/OrbitControls.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:50
GET file:///C:/WorkSpace/three.js-dev/examples/jsm/controls/OrbitControls.js net::ERR_FAILED
webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/examples/jsm/effects/OutlineEffect.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:51
GET file:///C:/WorkSpace/three.js-dev/examples/jsm/effects/OutlineEffect.js net::ERR_FAILED
webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/examples/jsm/loaders/MMDLoader.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:52
GET file:///C:/WorkSpace/three.js-dev/examples/jsm/loaders/MMDLoader.js net::ERR_FAILED
webgl_loader_mmd.html:1 Access to script at ‘file:///C:/WorkSpace/three.js-dev/examples/jsm/animation/MMDAnimationHelper.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
webgl_loader_mmd.html:53

1 Like

even if you could run bare html, it can’t fetch local assets (models, environments etc) because browser policies forbid it. i guess you could switch that off somehow. but most likely you are expected to install a http server.

these examples are a little … odd, i don’t know why they’re not folders with a package.json inside so that each could be npm run dev’…ed to start. three has a history of making these things incredibly difficult. it’s a wonder that it can even be npm installed. and i guess now that you can, something else must be held back for a few years.

if you just want to run any example without having to go through vs code, you’re still going to need a server setup to allow cors header access in your browser, you can simply install simplewebserver and open the three.js directory in this…