• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

VS Code ExtendScript dlopen error when trying to run exportToJSXBin.js

Community Beginner ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

I'm trying to write some scripts to automate a build process and I can't seem to get exportToJSXBin.js working! It keeps giving me this:

 

node:internal/modules/cjs/loader:1289
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: dlopen(/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node, 1): no suitable image found.  Did find:
/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node: mach-o, but wrong architecture
/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node: mach-o, but wrong architecture

    at Module._extensions..node (node:internal/modules/cjs/loader:1289:18)
    at Module.load (node:internal/modules/cjs/loader:1068:32)
    at Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1092:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at GetCoreLib (/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/public-scripts/exportToJSXBin.js:28:24)
    at initializeCore (/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/public-scripts/exportToJSXBin.js:250:20)
    at Object.<anonymous> (/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/public-scripts/exportToJSXBin.js:273:1)
    at Module._compile (node:internal/modules/cjs/loader:1205:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1259:10) {

  code: 'ERR_DLOPEN_FAILED'
}

 

 

There are a bunch of solutions suggested for similar errors on other tools, I tried a couple and no joy and frankly some of the others look a bit heavy handed and I'm worried I might do something I'll regret. Anyone experienced this with VS Code ExtendScript?

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Dec 20, 2022 Dec 20, 2022

@tommyc71769282 Could you also try using the file command on your Node executable?

 

On my machine (M1 Max) I installed Node with NVM so I had to do the following:

# cd ~/.nvm/versions/node/v16.13.0/bin
# file node

And that resulted in the following output:

# node: Mach-O 64-bit executable x86_64

This shows that my v16.13.0 installation of NodeJS is the Intel-only build. Universal binaries would result in something like this:

# node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit e
...

Votes

Translate

Translate
LEGEND ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

Is this on Apple Silicon?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

Yes, MacBook Pro M1, Big Sur (although I do also have another MacBook on Monterey).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

Hey, are you on an M1 chip?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

Hi Malcolm. It's Tommy. Long time! How are you?

I'm on a MacBook Pro M1, Big Sur (although I do also have another MacBook on Monterey).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

Hey, Doing alright, thought it was you but didn't want to presume, I was going to point you in the direction of @Harbs. answer, so make sure and give him the kudos.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

I wanted to respond with a laughing emoji, but I've never figured out these forums. I still remember fondly when we could particiapte by email... 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

I’m responding to this by email because I remember the forums PM talking about supporting this use case…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

@ErinFWe used to be able to subscribe to specific forums by email as a first-class client. I had a number of filters which grouped forum discussions into folders on my computer. This was for *all* discussions whether or not I participated. If that works, I'd likely participate more than I currently do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

ah those where the days, 😄

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

You have to use VSCode running in Rosetta mode...

 

But @sberic can weigh in...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

I am running VS Code in Rosetta mode. It works fine in general but the exportToJSXBin.js script generates this error when I try to run it from Terminal.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

The shell script would need to be run in Rosetta too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 15, 2022 Dec 15, 2022

Copy link to clipboard

Copied

The error you're reporting suggests that it is not being run under Rosetta 2:

 

node:internal/modules/cjs/loader:1289
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: dlopen(/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node, 1): no suitable image found.  Did find:
/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node: mach-o, but wrong architecture

That "mach-o, but wrong architecture" bit is a strong indicator that you're not actually running VS Code in Intel mode.

 

You might try running your code (VS Code command line binary) instance by prefixing the command with "arch -x86_64".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 16, 2022 Dec 16, 2022

Copy link to clipboard

Copied

Still no joy I'm afraid. I'm definitely running VS Code and Terminal in Rosetta, still get the same error as above. I have also tried arch -x86_64 and that gives me another error: arch: posix_spawnp: node: Bad CPU type in executable

Tried running softwareupdate --install-rosetta to fix that and still the same result... 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

@tommyc71769282  What is the specific command that you're using to start NodeJS? Additionally, how did you install NodeJS? Can you confirm that you have a Universal build of NodeJS installed or have otherwise installed the Intel version?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

@tommyc71769282 Could you also try using the file command on your Node executable?

 

On my machine (M1 Max) I installed Node with NVM so I had to do the following:

# cd ~/.nvm/versions/node/v16.13.0/bin
# file node

And that resulted in the following output:

# node: Mach-O 64-bit executable x86_64

This shows that my v16.13.0 installation of NodeJS is the Intel-only build. Universal binaries would result in something like this:

# node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
# node (for architecture x86_64):	Mach-O 64-bit executable x86_64
# node (for architecture arm64):	Mach-O 64-bit executable arm64

 Can you please try running that file command on your node binary to see what version(s) it was compiled for?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

LATEST

@sberic this seems to have done the trick! I had always installed node with nvm but I could not get it to install a universal binary at all no matter what I tried. I could however get it to install an older x86_64 version as well as my arm64 versions and I can use nvm use in my script to explicitly run exportToJSXBin.js via that version of node. Thanks for your help, much appreciated!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines