References broken when building for prod

Right now it looks like this, still no changes however

/** @type {import('next').NextConfig} */
const { hostname } = require('os');
const webpack = require('webpack');

const nextConfig = (module.exports = async () => {
  const { needleNext } = await import(
    '@needle-tools/engine/plugins/next/index.js'
  );
  return needleNext(
    {
      images: {
        remotePatterns: [{ hostname: 'assetstore.nordpeis.com' }],
      },
      webpack: (config) => {
        config.resolve.extensionAlias = {
          '.js': ['.js', '.ts'],
        };
        config.optimization.concatenateModules = false;
        config.output.pathinfo = 'verbose';
        return config;
      },
    },
    { modules: { webpack } }
  );
  nextconfig.transpilePackages.splice(
    nextconfig.transpilePackages.indexOf('@needle-tools/engine'),
    1
  );
  return c;
});

module.exports = nextConfig;

by user 219335701790064640

You return before the transpilePackages changes can run so it can’t work + you need to return the nextconfig object not c sorry (i just renamed it for the screenshot and forgot the return param name)

Ok, sorry.
TypeScript is really not something I understand fully, and our config files difer enough so that I don’t fulle understand. (the auto-complete wont help me much neither)

Given the config file I sent, where does the transpilePackages go?

(Again, sorry… I’m a Unity Tech Artist, so TS and web goes a bit over my head)

by user 219335701790064640

const nextConfig = (module.exports = async () => {
  const { needleNext } = await import(
    '@needle-tools/engine/plugins/next/index.js'
  );
  const config = needleNext(
    {
      images: {
        remotePatterns: [{ hostname: 'assetstore.nordpeis.com' }],
      },
      webpack: (config) => {
        config.resolve.extensionAlias = {
          '.js': ['.js', '.ts'],
        };
        config.optimization.concatenateModules = false;
        config.output.pathinfo = 'verbose';
        return config;
      },
    },
    { modules: { webpack } }
  );
  config.transpilePackages.splice(
    config.transpilePackages.indexOf('@needle-tools/engine'),
    1
  );
  return config;
});

It is strange. The direct reference to the script established in Unity is still lost.
And when changing values on the Volume.sharedProfile, even though the value does change when logged, there is no effect in the scene.

I have copied in your script and deleted the cache.

by user 219335701790064640

What tells you that the connection is lost? When i log them in onEnable in FocusUpdater they’re correct.

But yes the effect doesnt update - I’ll make a release to fix that (apparently the postprocessing DOF effect changed their API with just a warning in the code and not any error so we didnt notice that earlier)

The first log online 36 returns undefined in prod and not in dev

after my hacky fix it logs correctly on line 50.

But I also noticed that canvas buttons stop working in prod as well. So it is a larger issue

Good to know the dof will be fixed! :slight_smile:

by user 219335701790064640

Yes because you’re missing @serializable(FireplaceController) above the field. The browser console tells you that as well when you start in dev (and you should see a warning message)

Hello @SteffenMFureli could you try updating to the package 3.31.2 in Unity and perhaps run a “clean install” (holding ALT + clicking Install in ExportInfo)
You can then change the next config back to:

const nextConfig = (module.exports = async () => {
  const { needleNext } = await import(
    '@needle-tools/engine/plugins/next/index.js'
  );
  return needleNext(
    {
      images: {
        remotePatterns: [{ hostname: 'assetstore.nordpeis.com' }],
      },
      webpack: (config) => {
        config.resolve.extensionAlias = {
          '.js': ['.js', '.ts'],
        };
        return config;
      },
    },
    { modules: { webpack } }
  );
});

(as it was without modifications)

Let me know how it goes

Ok, so the reference problem is gone, finally!
Thanks!

But the dof is still an issue…

I get these warnings when running the app

by user 219335701790064640

I am checking to see if the error, through all my testing now lies on my end

by user 219335701790064640

Regarding DOF being an issue: can you elaborate? It worked fine for me with that version. After changing the distance you set obviously since with 1 meter focus distance everything was just blurry

I added my sin test function and saw the DOF focus plane moving through the room

When logging the value I’ve set from the runtime I get a value greater than 1.
But the render behaves as if it has a value of 0


by user 219335701790064640

this looks like a wrong engine verson. The material name changed

What does this mean? It works on dev?

by user 219335701790064640

can you send a screenshot from the footer of the ExportInfo component showing the versions?

by user 219335701790064640

Yes i noticed - but it didnt in production - my guess is that since it’s marked as deprecated it’s being stripped by next/webpack but I’m not sure here