PostProcessingUtils is not exported

If we import postprocessing nodes from jsm folder like this

import {ao} from 'three/addons/tsl/display/GTAONode';

an error occurs in the console,

PostProcessingUtils is not exported from Three.js

In the source of GTAONode, the code is

import { PostProcessingUtils } from 'three';

But this three means three/webgpu. It works in the offical examples of three.js, because there is an importmap in the html file. But in my app, it’s broken.
@Mugen87 @sunag Is there a proper way to handle it? I’m using vite to pack my app, I’ve tried to use resolve.alias in config file, it haven’t work fine yet.

I have filed a PR with a fix since the import path should be different:

1 Like

Also there is a Vite alias configuration that we currently recommend until we have reorganized the project’s exports.

// vite.config.js

import { defineConfig } from 'vite';

export default defineConfig({
  resolve: {
    alias: {
       'three/examples/jsm': 'three/examples/jsm',
       'three/addons': 'three/examples/jsm',
       'three/tsl': 'three/webgpu',
       'three': 'three/webgpu',
    }
  }
});
2 Likes

Thanks so much! :clap: