Skip to content

[Bug] Terminal module resolution fails - searches in app.asar instead of project directory #2927

@CodeYu001

Description

@CodeYu001

Description

When running yarn start in Onlook's built-in terminal, the module resolution fails because Node.js is incorrectly resolving modules from Onlook's application package path (/Applications/Onlook.app/Contents/Resources/app.asar) instead of the project's node_modules directory.

Steps to Reproduce

  1. Open a React/UmiJS project in Onlook
  2. Open the built-in terminal in Onlook
  3. Run yarn start command
  4. Observe the module resolution error

Expected Behavior

The terminal should resolve modules from the project's node_modules directory, similar to how external terminals (iTerm2, Terminal.app) work.

Actual Behavior

Module resolution fails with errors like:

Command error detected: Cannot find module '@umijs/preset-react' from '/Applications/Onlook.app/Contents/Resources/app.asar'

The error stack trace shows that Node.js is trying to resolve modules from Onlook's app.asar path instead of the project directory.

Environment

  • OS: macOS Ventura 13.7.4
  • Onlook Version: 0.2.32
  • Project Type: React with UmiJS
  • Package Manager: Yarn v1.22.22

Workaround

Running the same command in an external terminal (iTerm2, Terminal.app, etc.) works perfectly without any issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions