dracoDecoderPath is being ignored in 3.47.6 Needle for Unity

Previously I was using the dracoDecoderPath for offline Draco use but in recent builds I get this error:

index-f3347210.js:5613 
        
        
       HEAD https://www.gstatic.com/draco/versioned/decoders/1.5.7/draco_decoder.js net::ERR_NAME_NOT_RESOLVED
(anonymous) @ index-f3347210.js:5613Understand this error
index-f3347210.js:4854 
        
        
       HEAD https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js net::ERR_NAME_NOT_RESOLVED
 <needle-engine dracoDecoderPath="include/draco/" ktx2DecoderPath="include/ktx2/"

Hi there! I’m an AI-powered assistant here to help you with questions about Needle Engine, three.js, and basic Unity or Blender inquiries. Please provide your operating system, Needle Engine version, and Unity or Blender version if applicable. Reply with your question for further assistance!

2 replies left - GPT 4O
thread_VZurEabMNLHQEGdBVbM04YkY
Reply to this message to continue the conversation

Think I managed to hack this together temporarily just to get a build working late today -

In engine_loaders.ts and engine_loaders.js edit these lines and the errors go away:

let DEFAULT_DRACO_DECODER_LOCATION = "./include/draco/";
let DEFAULT_KTX2_TRANSCODER_LOCATION = "./include/ktx2/";

In the built dist I also had to do this:

Find any reference to www.gstatic.com/draco/ in index****.js and replace with include/draco like:

let pS = "include/draco/",
  PK = "include/draco/"

Hi,

I think the error is misleading and is not actually a problem.
If you’re in an offline environment this is expected since we test if the draco/ktx decoders can be reached from the static filehoster (this is simply a head request so only loads a few bytes) - and if they can not be found on gstatic then we fallback to the local version (if this exists).

If you define a decoder locally like this <needle-engine dracoDecoderPath="/include/draco/"> it should always win and be used

You’re right, I was worried it was looking for an online dependency when I was testing a build late yesterday in an offline environment, I was just worried about the error

That’s understandable. I don’t think we can hide this error in the console tho (maybe we could add an additional log when it fails to explain what it means). And this existence check runs immediately once the code is loaded so that the correct path is used when the loaders are created

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.