Native extensions should show an error if failing during development build

I was trying to use the defos native extension in a development build and kept getting a nil value. So I tried doing a release build and it found errors. I cleaned up those errors and defos finally worked :smile:

Just thought I’d throw in the idea of triggering an error message if the native extension fails to build during development.

1 Like

It should show errors always, regardless of build or bundle. @Mathias_Westerdahl?

Did you happen to have the debug features enabled? Was it saying null/null for the error? I’ve seen that too.

1 Like

“Just thought I’d throw in the idea of triggering an error message if the native extension fails to build during development.”

Yes, that’s the main idea. It seems you’ve found a bug.

I would really like to know more about what errors you got in release mode that you didn’t in debug mode. I’m searching the build logs on the server but I don’t find anything related to DefOS (going back
What platform did you build for?
Could you perhaps create to replicate the issue and share it with me? (mathias.westerdahl@king.com)

1 Like

Oddly enough, I can’t replicate the issue. Somehow my project was at a point where the development build worked, but the release build would fail. In that situation, the errors had to do with the fact that I was requiring modules that didn’t exist.

local io = require("io")
local os = require("os")

Somehow my development builds continued to work with those, but the release build would fail. Once those lines were removed, everything was good.

As an aside, I don’t believe it had anything to do with defos, I just happened to be using defos as my first native extension.

2 Likes

You should not require io and os. They are already loaded and available on the global table.

1 Like

Yeah, I realized that after I got those build errors :smile:. Thanks for the heads up.

1 Like