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

Custom yarn bundle: "cannot find module" error #11977

Closed
1 task done
Nelfimov opened this issue May 17, 2024 · 2 comments
Closed
1 task done

Custom yarn bundle: "cannot find module" error #11977

Nelfimov opened this issue May 17, 2024 · 2 comments
Labels
bug [core label] javascript JavaScript programming language support language An umbrella label for all programming languages syntax behaviors tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support

Comments

@Nelfimov
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Opening project with custom yarn bundle (based on yarn 4) shows "cannot find module", even though all dependencies are installed and project launches.

Yarn bundle is built via @yarnpkg/builder

Minimal repo reproducing the bug: https://github.com/atls-lab/zed-demo

Environment

Zed: v0.135.2 (Zed)
OS: macOS 14.4.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-05-17 at 16 23 16

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

2024-05-17T16:10:21+03:00 [INFO] starting language server "json-language-server", path: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", id: 3
2024-05-17T16:10:21+03:00 [INFO] fetching latest version of language server "json-language-server"
2024-05-17T16:10:21+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:10:22+03:00 [INFO] downloading language server "json-language-server"
2024-05-17T16:10:22+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:10:22+03:00 [INFO] starting language server. binary path: "/Users/nikoroach/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", args: ["/Users/nikoroach/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-json-languageserver/bin/vscode-json-languageserver", "--stdio"]
2024-05-17T16:10:27+03:00 [INFO] completion out of expected range
2024-05-17T16:10:27+03:00 [INFO] completion out of expected range
2024-05-17T16:10:27+03:00 [INFO] completion out of expected range
2024-05-17T16:10:27+03:00 [INFO] completion out of expected range
2024-05-17T16:10:48+03:00 [INFO] Prettier config file "package.json" changed, reloading prettier instances for worktree 1241245548619
2024-05-17T16:10:53+03:00 [INFO] Prettier config file "package.json" changed, reloading prettier instances for worktree 1241245548619
2024-05-17T16:11:11+03:00 [INFO] Prettier config file "package.json" changed, reloading prettier instances for worktree 1241245548619
2024-05-17T16:11:18+03:00 [INFO] reload git repository ".git"
2024-05-17T16:11:19+03:00 [INFO] reload git repository ".git"
2024-05-17T16:11:56+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:11:56+03:00 [INFO] starting language servers for YAML: yaml-language-server
2024-05-17T16:11:56+03:00 [INFO] starting language server "yaml-language-server", path: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", id: 4
2024-05-17T16:11:56+03:00 [INFO] fetching latest version of language server "yaml-language-server"
2024-05-17T16:11:56+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:11:57+03:00 [INFO] downloading language server "yaml-language-server"
2024-05-17T16:11:57+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:11:57+03:00 [INFO] starting language server. binary path: "/Users/nikoroach/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", args: ["/Users/nikoroach/Library/Application Support/Zed/languages/yaml-language-server/node_modules/yaml-language-server/bin/yaml-language-server", "--stdio"]
2024-05-17T16:11:59+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:11:59+03:00 [INFO] starting language servers for JSON: json-language-server
2024-05-17T16:12:21+03:00 [INFO] reload git repository ".git"
2024-05-17T16:12:21+03:00 [INFO] reload git repository ".git"
2024-05-17T16:12:39+03:00 [INFO] Prettier config file "package.json" changed, reloading prettier instances for worktree 1241245548619
2024-05-17T16:13:00+03:00 [WARN] Generic lsp request to node failed: Unhandled method textDocument/definition
2024-05-17T16:13:00+03:00 [ERROR] crates/editor/src/element.rs:274: Unhandled method textDocument/definition
2024-05-17T16:13:02+03:00 [WARN] Generic lsp request to node failed: Unhandled method textDocument/definition
2024-05-17T16:13:02+03:00 [ERROR] crates/editor/src/element.rs:274: Unhandled method textDocument/definition
2024-05-17T16:13:04+03:00 [ERROR] unexpected item event after pane was dropped
2024-05-17T16:13:17+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:13:17+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:13:17+03:00 [INFO] starting language server "typescript-language-server", path: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", id: 5
2024-05-17T16:13:17+03:00 [INFO] starting language server "tailwindcss-language-server", path: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", id: 6
2024-05-17T16:13:17+03:00 [INFO] starting language server "eslint", path: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", id: 7
2024-05-17T16:13:17+03:00 [INFO] fetching latest version of language server "typescript-language-server"
2024-05-17T16:13:17+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:13:17+03:00 [INFO] fetching latest version of language server "tailwindcss-language-server"
2024-05-17T16:13:17+03:00 [INFO] fetching latest version of language server "eslint"
2024-05-17T16:13:17+03:00 [INFO] downloading language server "eslint"
2024-05-17T16:13:17+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:13:17+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:13:17+03:00 [INFO] starting language server. binary path: "/Users/nikoroach/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", args: ["/Users/nikoroach/Library/Application Support/Zed/languages/eslint/vscode-eslint-release/2.4.4/vscode-eslint/server/out/eslintServer.js", "--stdio"]
2024-05-17T16:13:17+03:00 [INFO] Language server with id 7 sent unhandled notification window/logMessage:
{
  "type": 3,
  "message": "ESLint server running in node v18.15.0"
}
2024-05-17T16:13:17+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/app-router/entrypoints/renderer/src/app/layout.tsx"
  }
}
2024-05-17T16:13:17+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:13:17+03:00 [INFO] downloading language server "tailwindcss-language-server"
2024-05-17T16:13:18+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:13:18+03:00 [INFO] starting language server. binary path: "/Users/nikoroach/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", args: ["/Users/nikoroach/Library/Application Support/Zed/languages/tailwindcss-language-server/node_modules/.bin/tailwindcss-language-server", "--stdio"]
2024-05-17T16:13:18+03:00 [INFO] downloading language server "typescript-language-server"
2024-05-17T16:13:18+03:00 [INFO] Node runtime install_if_needed
2024-05-17T16:13:18+03:00 [INFO] starting language server. binary path: "/Users/nikoroach/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo", args: ["/Users/nikoroach/Library/Application Support/Zed/languages/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs", "--stdio"]
2024-05-17T16:13:18+03:00 [INFO] Language server with id 5 sent unhandled notification window/logMessage:
{
  "type": 2,
  "message": "[lspserver] Typescript specified through user setting ignored due to invalid path \"/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/lib/tsserver.js\""
}
2024-05-17T16:13:18+03:00 [INFO] Language server with id 5 sent unhandled notification window/logMessage:
{
  "type": 3,
  "message": "Using Typescript version (bundled) 5.4.5 from path \"/Users/nikoroach/Library/Application Support/Zed/languages/typescript-language-server/node_modules/typescript/lib/tsserver.js\""
}
2024-05-17T16:13:18+03:00 [INFO] Language server with id 5 sent unhandled notification $/typescriptVersion:
{
  "version": "5.4.5",
  "source": "bundled"
}
2024-05-17T16:13:18+03:00 [INFO] reload git repository ".git"
2024-05-17T16:13:42+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:13:42+03:00 [INFO] starting language servers for JSON: json-language-server
2024-05-17T16:13:57+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:13:57+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:13:57+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/app-router/entrypoints/renderer/src/app/layout.tsx"
  }
}
2024-05-17T16:14:01+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:14:01+03:00 [INFO] starting language servers for JSON: json-language-server
2024-05-17T16:14:18+03:00 [INFO] reload git repository ".git"
2024-05-17T16:14:32+03:00 [ERROR] crates/terminal_view/src/terminal_view.rs:285: error upgrading view
2024-05-17T16:14:33+03:00 [ERROR] crates/terminal_view/src/terminal_view.rs:285: error upgrading view
2024-05-17T16:14:40+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:14:40+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:14:40+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello/src/hello.component.tsx"
  }
}
2024-05-17T16:15:23+03:00 [INFO] reload git repository ".git"
2024-05-17T16:15:23+03:00 [INFO] reload git repository ".git"
2024-05-17T16:16:21+03:00 [WARN] Skipping path "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello" that has no prettier dependency and no workspaces section in its package.json
2024-05-17T16:16:21+03:00 [ERROR] Failed to determine prettier path for buffer: No prettier found in node_modules for ancestors of "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello/src/hello.component.tsx", but discovered prettier package.json dependency in "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo"
2024-05-17T16:16:21+03:00 [INFO] reload git repository ".git"
2024-05-17T16:16:21+03:00 [INFO] reload git repository ".git"
2024-05-17T16:16:28+03:00 [WARN] Skipping path "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello" that has no prettier dependency and no workspaces section in its package.json
2024-05-17T16:16:28+03:00 [ERROR] Failed to determine prettier path for buffer: No prettier found in node_modules for ancestors of "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello/src/hello.component.tsx", but discovered prettier package.json dependency in "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo"
2024-05-17T16:17:24+03:00 [INFO] reload git repository ".git"
2024-05-17T16:17:25+03:00 [INFO] reload git repository ".git"
2024-05-17T16:17:34+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:17:34+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:17:34+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/app-router/entrypoints/renderer/src/app/layout.tsx"
  }
}
2024-05-17T16:17:48+03:00 [ERROR] crates/terminal_view/src/terminal_view.rs:285: error upgrading view
2024-05-17T16:17:56+03:00 [ERROR] crates/terminal_view/src/terminal_view.rs:285: error upgrading view
2024-05-17T16:18:00+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:18:00+03:00 [INFO] starting language servers for JSON: json-language-server
2024-05-17T16:18:21+03:00 [WARN] Generic lsp request to node failed: Unhandled method textDocument/definition
2024-05-17T16:18:21+03:00 [WARN] Generic lsp request to node failed: Unhandled method textDocument/definition
2024-05-17T16:18:23+03:00 [INFO] reload git repository ".git"
2024-05-17T16:18:24+03:00 [INFO] reload git repository ".git"
2024-05-17T16:18:57+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:18:57+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:18:57+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello/src/hello.component.tsx"
  }
}
2024-05-17T16:19:00+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:19:00+03:00 [INFO] starting language servers for JSON: json-language-server
2024-05-17T16:19:16+03:00 [ERROR] crates/terminal_view/src/terminal_view.rs:285: error upgrading view
2024-05-17T16:19:17+03:00 [ERROR] unexpected item event after pane was dropped
2024-05-17T16:19:20+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:19:20+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:19:20+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello/src/hello.component.tsx"
  }
}
2024-05-17T16:19:22+03:00 [WARN] Skipping path "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello" that has no prettier dependency and no workspaces section in its package.json
2024-05-17T16:19:22+03:00 [ERROR] Failed to determine prettier path for buffer: No prettier found in node_modules for ancestors of "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/ui/hello/src/hello.component.tsx", but discovered prettier package.json dependency in "/Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo"
2024-05-17T16:19:26+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:27+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:49+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:49+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:50+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:50+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:50+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:50+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:50+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:50+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:51+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:51+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:51+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:51+03:00 [INFO] reload git repository ".git"
2024-05-17T16:19:51+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:00+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:00+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:00+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:01+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:01+03:00 [INFO] Prettier config file "package.json" changed, reloading prettier instances for worktree 1241245548619
2024-05-17T16:20:01+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:23+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:23+03:00 [INFO] reload git repository ".git"
2024-05-17T16:20:37+03:00 [INFO] reload git repository ".git"
2024-05-17T16:21:23+03:00 [INFO] reload git repository ".git"
2024-05-17T16:22:26+03:00 [INFO] reload git repository ".git"
2024-05-17T16:22:27+03:00 [INFO] reload git repository ".git"
2024-05-17T16:23:01+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:23:01+03:00 [INFO] starting language servers for TypeScript: typescript-language-server, eslint
2024-05-17T16:23:02+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/app-router/entrypoints/renderer/src/app/page.ts"
  }
}
2024-05-17T16:23:05+03:00 [INFO] Initializing default prettier with plugins {}
2024-05-17T16:23:05+03:00 [INFO] starting language servers for TSX: typescript-language-server, tailwindcss-language-server, eslint
2024-05-17T16:23:05+03:00 [INFO] Language server with id 7 sent unhandled notification eslint/noLibrary:
{
  "source": {
    "uri": "file:///Users/nikoroach/Documents/Typescript/atlantis/atls-lab-zed-demo/app-router/entrypoints/renderer/src/app/layout.tsx"
  }
}
2024-05-17T16:23:27+03:00 [INFO] reload git repository ".git"
2024-05-17T16:23:27+03:00 [INFO] reload git repository ".git"
2024-05-17T16:24:27+03:00 [INFO] reload git repository ".git"
2024-05-17T16:24:27+03:00 [INFO] reload git repository ".git"
2024-05-17T16:25:30+03:00 [INFO] reload git repository ".git"
2024-05-17T16:25:30+03:00 [INFO] reload git repository ".git"
@Nelfimov Nelfimov added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels May 17, 2024
@JosephTLyons JosephTLyons added typescript TypeScript programming language support javascript JavaScript programming language support language An umbrella label for all programming languages syntax behaviors tooling An umbrella label for language tools, linters, formatters, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels May 19, 2024
@db82407
Copy link

db82407 commented Jul 26, 2024

This is because yarn pnp projects don't populate node_modules.
It is also cause of #10107, which has been fixed by #13644.

You need to run yarn dlx @yarnpkg/sdks base in the root of your project and run preview containing the fix.

@Nelfimov
Copy link
Author

Yes, already checked it with the latest update. Works flawlessly.

Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] javascript JavaScript programming language support language An umbrella label for all programming languages syntax behaviors tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support
Projects
None yet
Development

No branches or pull requests

3 participants