Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'The define key "process.env.ProgramFiles(x86)" contains invalid identifier "ProgramFiles(x86)"' #60

Open
techsideofficial opened this issue Mar 23, 2024 · 2 comments

Comments

@techsideofficial
Copy link

techsideofficial commented Mar 23, 2024

image

@lyghtkruz
Copy link

I'm running into the same issue on Alma Linux:

$ pnpm build

> [email protected] build /home/kruz/embedded-app-sdk-main/examples/nested-messages
> node ./scripts/build.js

✘ [ERROR] The define key "process.env.BASH_FUNC_which%%" contains invalid identifier "BASH_FUNC_which%%"

/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1636
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
error: The define key "process.env.BASH_FUNC_which%%" contains invalid identifier "BASH_FUNC_which%%"
    at failureErrorWithLog (/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1636:15)
    at /home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1048:25
    at /home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:993:52
    at buildResponseToResult (/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1046:7)
    at /home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1075:16
    at responseCallbacks.<computed> (/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'The define key "process.env.BASH_FUNC_which%%" contains invalid identifier "BASH_FUNC_which%%"'
    }
  ],
  warnings: []
}
 ELIFECYCLE  Command failed with exit code 1.

@lyghtkruz
Copy link

lyghtkruz commented Mar 25, 2024

After grepping through the code, I couldn't find the problematic which function. Checking my environment, it appears my system has a weird "which" function defined:

]$ env | grep -i which
which_declare=declare -f
BASH_FUNC_which%%=() {  ( alias;
 eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@


]$ which which
which ()
{
    ( alias;
    eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
}

After unsetting the variable, I was able to run the build and I came up with a different error now.

✘ [ERROR] Could not resolve "../utils/MessageInterface"

    client/nested/old/index.ts:1:31:
      1 │ import {MessageInterface} from '../utils/MessageInterface';
        ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/kruz/embedded-app-sdk-main/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1636
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
client/nested/old/index.ts:1:31: ERROR: Could not resolve "../utils/MessageInterface"

You might have a weird environment variable that is causing a similar error. The MessageInterface is supposed to be a class defined in the example code, so I am going to dig around some more and will post if I find a solution.

--- edit
I had moved the index.html and index.ts from the sample code to try to put my own page up, that's why it couldn't find the class. Everything built properly once I put it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants