continue
continue copied to clipboard
Build does not work with node:21-bookworm as a base image
Before submitting your bug report
- [X] I believe this is a bug. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that reports the same bug
- [X] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: node:21-bookworm
- Continue: commit hash 889e55261bc147d55db33875cf525b80ae84bf19
Description
I cannot to build the plugin with a Dockerfile
To reproduce
I made the following Dockerfile to build the plugin:
FROM node:21-bookworm
COPY . /src
WORKDIR /src
RUN bash -x ./install-dependencies.sh
The docker build docker build . fails with the following error:
#8 154.6 [info] Building with esbuild...
#8 155.5 ▲ [WARNING] "./xhr-sync-worker.js" should be marked as external for use with "require.resolve" [require-resolve-not-external]
#8 155.5
#8 155.5 ../core/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:31:57:
#8 155.5 31 │ ... require.resolve ? require.resolve("./xhr-sync-worker.js") : null;
#8 155.5 ╵ ~~~~~~~~~~~~~~~~~~~~~~
#8 155.5
#8 156.7 [info] Building binaries with pkg...
#8 156.7 [info] Building darwin-x64...
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 1: use strict: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 2: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 3: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 4: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 5: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 6: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 7: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 8: Syntax error: "(" unexpected
#8 158.0 node:internal/errors:984
#8 158.0 const err = new Error(message);
#8 158.0 ^
#8 158.0
#8 158.0 Error: Command failed: npx pkg --no-bytecode --public-packages "*" --public pkgJson/darwin-x64 --out-path bin/darwin-x64
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 1: use strict: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 2: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 3: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 4: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 5: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 6: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 7: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 8: Syntax error: "(" unexpected
#8 158.0
#8 158.0 at genericNodeError (node:internal/errors:984:15)
#8 158.0 at wrappedFn (node:internal/errors:538:14)
#8 158.0 at checkExecSyncError (node:child_process:890:11)
#8 158.0 at execSync (node:child_process:962:15)
#8 158.0 at /src/pkg/build.js:122:5
#8 158.0 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
#8 158.0 status: 2,
#8 158.0 signal: null,
#8 158.0 output: [
#8 158.0 null,
#8 158.0 Buffer(0) [Uint8Array] [],
#8 158.0 Buffer(613) [Uint8Array] [
#8 158.0 47, 114, 111, 111, 116, 47, 46, 110, 112, 109, 47, 95,
#8 158.0 110, 112, 120, 47, 99, 100, 57, 57, 52, 52, 51, 50,
#8 158.0 57, 55, 48, 101, 98, 99, 56, 102, 47, 110, 111, 100,
#8 158.0 101, 95, 109, 111, 100, 117, 108, 101, 115, 47, 46, 98,
#8 158.0 105, 110, 47, 112, 107, 103, 58, 32, 49, 58, 32, 117,
#8 158.0 115, 101, 32, 115, 116, 114, 105, 99, 116, 58, 32, 110,
#8 158.0 111, 116, 32, 102, 111, 117, 110, 100, 10, 47, 114, 111,
#8 158.0 111, 116, 47, 46, 110, 112, 109, 47, 95, 110, 112, 120,
#8 158.0 47, 99, 100, 57,
#8 158.0 ... 513 more items
#8 158.0 ]
#8 158.0 ],
#8 158.0 pid: 542,
#8 158.0 stdout: Buffer(0) [Uint8Array] [],
#8 158.0 stderr: Buffer(613) [Uint8Array] [
#8 158.0 47, 114, 111, 111, 116, 47, 46, 110, 112, 109, 47, 95,
#8 158.0 110, 112, 120, 47, 99, 100, 57, 57, 52, 52, 51, 50,
#8 158.0 57, 55, 48, 101, 98, 99, 56, 102, 47, 110, 111, 100,
#8 158.0 101, 95, 109, 111, 100, 117, 108, 101, 115, 47, 46, 98,
#8 158.0 105, 110, 47, 112, 107, 103, 58, 32, 49, 58, 32, 117,
#8 158.0 115, 101, 32, 115, 116, 114, 105, 99, 116, 58, 32, 110,
#8 158.0 111, 116, 32, 102, 111, 117, 110, 100, 10, 47, 114, 111,
#8 158.0 111, 116, 47, 46, 110, 112, 109, 47, 95, 110, 112, 120,
#8 158.0 47, 99, 100, 57,
#8 158.0 ... 513 more items
#8 158.0 ]
#8 158.0 }
#8 158.0
#8 158.0 Node.js v21.7.2
#8 ERROR: process "/bin/sh -c bash -x ./install-dependencies.sh" did not complete successfully: exit code: 1
------
> [4/4] RUN bash -x ./install-dependencies.sh:
158.0 105, 110, 47, 112, 107, 103, 58, 32, 49, 58, 32, 117,
158.0 115, 101, 32, 115, 116, 114, 105, 99, 116, 58, 32, 110,
158.0 111, 116, 32, 102, 111, 117, 110, 100, 10, 47, 114, 111,
158.0 111, 116, 47, 46, 110, 112, 109, 47, 95, 110, 112, 120,
158.0 47, 99, 100, 57,
158.0 ... 513 more items
158.0 ]
158.0 }
158.0
158.0 Node.js v21.7.2
------
WARNING: current commit information was not captured by the build: git was not found in the system: exec: "git": executable file not found in $PATH
Dockerfile:4
--------------------
2 | COPY . /src
3 | WORKDIR /src
4 | >>> RUN bash -x ./install-dependencies.sh
5 |
--------------------
ERROR: failed to solve: process "/bin/sh -c bash -x ./install-dependencies.sh" did not complete successfully: exit code: 1
For the "use strict: not found" issue, I could find a workaround by adding "#!/usr/bin/env node" as suggested here:
https://stackoverflow.com/questions/34353512/node-npm-package-throw-use-strict-command-not-found-after-publish-and-install-g
Anyone can reproduce?
Log output
I made the following Dockerfile to build the plugin:
FROM node:21-bookworm
COPY . /src
WORKDIR /src
RUN bash -x ./install-dependencies.sh
The docker build docker build . fails with the following error:
#8 154.6 [info] Building with esbuild...
#8 155.5 ▲ [WARNING] "./xhr-sync-worker.js" should be marked as external for use with "require.resolve" [require-resolve-not-external]
#8 155.5
#8 155.5 ../core/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:31:57:
#8 155.5 31 │ ... require.resolve ? require.resolve("./xhr-sync-worker.js") : null;
#8 155.5 ╵ ~~~~~~~~~~~~~~~~~~~~~~
#8 155.5
#8 156.7 [info] Building binaries with pkg...
#8 156.7 [info] Building darwin-x64...
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 1: use strict: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 2: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 3: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 4: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 5: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 6: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 7: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 8: Syntax error: "(" unexpected
#8 158.0 node:internal/errors:984
#8 158.0 const err = new Error(message);
#8 158.0 ^
#8 158.0
#8 158.0 Error: Command failed: npx pkg --no-bytecode --public-packages "*" --public pkgJson/darwin-x64 --out-path bin/darwin-x64
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 1: use strict: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 2: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 3: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 4: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 5: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 6: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 7: var: not found
#8 158.0 /root/.npm/_npx/cd994432970ebc8f/node_modules/.bin/pkg: 8: Syntax error: "(" unexpected
#8 158.0
#8 158.0 at genericNodeError (node:internal/errors:984:15)
#8 158.0 at wrappedFn (node:internal/errors:538:14)
#8 158.0 at checkExecSyncError (node:child_process:890:11)
#8 158.0 at execSync (node:child_process:962:15)
#8 158.0 at /src/pkg/build.js:122:5
#8 158.0 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
#8 158.0 status: 2,
#8 158.0 signal: null,
#8 158.0 output: [
#8 158.0 null,
#8 158.0 Buffer(0) [Uint8Array] [],
#8 158.0 Buffer(613) [Uint8Array] [
#8 158.0 47, 114, 111, 111, 116, 47, 46, 110, 112, 109, 47, 95,
#8 158.0 110, 112, 120, 47, 99, 100, 57, 57, 52, 52, 51, 50,
#8 158.0 57, 55, 48, 101, 98, 99, 56, 102, 47, 110, 111, 100,
#8 158.0 101, 95, 109, 111, 100, 117, 108, 101, 115, 47, 46, 98,
#8 158.0 105, 110, 47, 112, 107, 103, 58, 32, 49, 58, 32, 117,
#8 158.0 115, 101, 32, 115, 116, 114, 105, 99, 116, 58, 32, 110,
#8 158.0 111, 116, 32, 102, 111, 117, 110, 100, 10, 47, 114, 111,
#8 158.0 111, 116, 47, 46, 110, 112, 109, 47, 95, 110, 112, 120,
#8 158.0 47, 99, 100, 57,
#8 158.0 ... 513 more items
#8 158.0 ]
#8 158.0 ],
#8 158.0 pid: 542,
#8 158.0 stdout: Buffer(0) [Uint8Array] [],
#8 158.0 stderr: Buffer(613) [Uint8Array] [
#8 158.0 47, 114, 111, 111, 116, 47, 46, 110, 112, 109, 47, 95,
#8 158.0 110, 112, 120, 47, 99, 100, 57, 57, 52, 52, 51, 50,
#8 158.0 57, 55, 48, 101, 98, 99, 56, 102, 47, 110, 111, 100,
#8 158.0 101, 95, 109, 111, 100, 117, 108, 101, 115, 47, 46, 98,
#8 158.0 105, 110, 47, 112, 107, 103, 58, 32, 49, 58, 32, 117,
#8 158.0 115, 101, 32, 115, 116, 114, 105, 99, 116, 58, 32, 110,
#8 158.0 111, 116, 32, 102, 111, 117, 110, 100, 10, 47, 114, 111,
#8 158.0 111, 116, 47, 46, 110, 112, 109, 47, 95, 110, 112, 120,
#8 158.0 47, 99, 100, 57,
#8 158.0 ... 513 more items
#8 158.0 ]
#8 158.0 }
#8 158.0
#8 158.0 Node.js v21.7.2
#8 ERROR: process "/bin/sh -c bash -x ./install-dependencies.sh" did not complete successfully: exit code: 1
------
> [4/4] RUN bash -x ./install-dependencies.sh:
158.0 105, 110, 47, 112, 107, 103, 58, 32, 49, 58, 32, 117,
158.0 115, 101, 32, 115, 116, 114, 105, 99, 116, 58, 32, 110,
158.0 111, 116, 32, 102, 111, 117, 110, 100, 10, 47, 114, 111,
158.0 111, 116, 47, 46, 110, 112, 109, 47, 95, 110, 112, 120,
158.0 47, 99, 100, 57,
158.0 ... 513 more items
158.0 ]
158.0 }
158.0
158.0 Node.js v21.7.2
------
WARNING: current commit information was not captured by the build: git was not found in the system: exec: "git": executable file not found in $PATH
Dockerfile:4
--------------------
2 | COPY . /src
3 | WORKDIR /src
4 | >>> RUN bash -x ./install-dependencies.sh
5 |
--------------------
ERROR: failed to solve: process "/bin/sh -c bash -x ./install-dependencies.sh" did not complete successfully: exit code: 1
For the "use strict: not found" issue, I could find a workaround by adding "#!/usr/bin/env node" as suggested here:
https://stackoverflow.com/questions/34353512/node-npm-package-throw-use-strict-command-not-found-after-publish-and-install-g
Anyone can reproduce?
@zoobab This should be solved on the preview branch. It was a matter of renaming a folder that had a naming conflict with the "pkg" dependency. Let me know if not and I'll take another look!
I tried now the preview branch, but got other errors:
#8 18.31 + echo 'Installing GUI extension dependencies...'
#8 18.31 + pushd gui
#8 18.31 + npm install
#8 31.37
#8 31.37 added 550 packages, and audited 552 packages in 13s
#8 31.37
#8 31.37 213 packages are looking for funding
#8 31.37 run `npm fund` for details
#8 31.37
#8 31.37 found 0 vulnerabilities
#8 31.40 + npm link @continuedev/core
#8 33.60
#8 33.60 added 1 package, and audited 553 packages in 2s
#8 33.60
#8 33.60 213 packages are looking for funding
#8 33.60 run `npm fund` for details
#8 33.60
#8 33.60 found 0 vulnerabilities
#8 33.61 + npm run build
#8 33.85
#8 33.85 > build
#8 33.85 > tsc && vite build
#8 33.85
#8 45.96 ../extensions/vscode/src/autocomplete/lsp.ts(1,34): error TS2307: Cannot find module 'core' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/autocomplete/lsp.ts(2,45): error TS2307: Cannot find module 'core/autocomplete/ast' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/autocomplete/lsp.ts(3,37): error TS2307: Cannot find module 'core/autocomplete/ranking' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/autocomplete/lsp.ts(4,41): error TS2307: Cannot find module 'core/commands/util' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/autocomplete/lsp.ts(5,25): error TS2307: Cannot find module 'vscode' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/util/expandSnippet.ts(1,28): error TS2307: Cannot find module 'core' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/util/expandSnippet.ts(2,37): error TS2307: Cannot find module 'core/indexing/ignore' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/util/expandSnippet.ts(3,34): error TS2307: Cannot find module 'core/util' or its corresponding type declarations.
#8 45.96 ../extensions/vscode/src/util/expandSnippet.ts(4,34): error TS2307: Cannot find module 'core/util/treeSitter' or its corresponding type declarations.
#8 45.96 src/hooks/useSetup.ts(77,5): error TS2554: Expected 2-3 arguments, but got 1.
#8 ERROR: process "/bin/sh -c bash -x ./install-dependencies.sh" did not complete successfully: exit code: 2
------
> [4/4] RUN bash -x ./install-dependencies.sh:
45.96 ../extensions/vscode/src/autocomplete/lsp.ts(1,34): error TS2307: Cannot find module 'core' or its corresponding type declarations.
45.96 ../extensions/vscode/src/autocomplete/lsp.ts(2,45): error TS2307: Cannot find module 'core/autocomplete/ast' or its corresponding type declarations.
45.96 ../extensions/vscode/src/autocomplete/lsp.ts(3,37): error TS2307: Cannot find module 'core/autocomplete/ranking' or its corresponding type declarations.
45.96 ../extensions/vscode/src/autocomplete/lsp.ts(4,41): error TS2307: Cannot find module 'core/commands/util' or its corresponding type declarations.
45.96 ../extensions/vscode/src/autocomplete/lsp.ts(5,25): error TS2307: Cannot find module 'vscode' or its corresponding type declarations.
45.96 ../extensions/vscode/src/util/expandSnippet.ts(1,28): error TS2307: Cannot find module 'core' or its corresponding type declarations.
45.96 ../extensions/vscode/src/util/expandSnippet.ts(2,37): error TS2307: Cannot find module 'core/indexing/ignore' or its corresponding type declarations.
45.96 ../extensions/vscode/src/util/expandSnippet.ts(3,34): error TS2307: Cannot find module 'core/util' or its corresponding type declarations.
45.96 ../extensions/vscode/src/util/expandSnippet.ts(4,34): error TS2307: Cannot find module 'core/util/treeSitter' or its corresponding type declarations.
45.96 src/hooks/useSetup.ts(77,5): error TS2554: Expected 2-3 arguments, but got 1.
@zoobab thanks again for sending the whole logs and making this easy! I reproduced, made the fix, and have now pushed the changes to preview: https://github.com/continuedev/continue/commit/27a9aa89e38e3bab8816ee52683cd90cd81a723f, https://github.com/continuedev/continue/commit/0f7aed6f4845d04e9f76af7a06091ce8b2ed0b26
As always, let me know if any other problems come up : )
Despite your 2 commits, I still have the same issue with "../extensions/vscode/src/autocomplete/lsp.ts(1,34): error TS2307: Cannot find module 'core' or its corresponding type declarations." ...
I think they may be a circular dependency between gui and extensions, I installed/built them repeatedly one after the other until they both complete successfully. It seems to go gui -> core -> extensions -> gui, here maybe?:
https://github.com/continuedev/continue/blob/b0cdd0ed920bde2d25915dd61920569c03b6dc63/core/context/retrieval/retrieval.ts#L70-L72
Introduced by #1088 I believe
Envrionment:
OS: Windows 10 cargo 1.76.0 (c84b36747 2024-01-18) node v20.12.1 yarn 1.22.18 commit: 301263930f096cd82b82b95d0e20584663c62a5e
Reproduce step: ./install-dependencies.ps1
Error Log: ......
[email protected] build node build.js
[info] Copied [info] Downloading prebuilt lancedb... [info] Downloading darwin-x64... npm WARN using --force Recommended protections disabled. [info] Downloading darwin-arm64... npm WARN using --force Recommended protections disabled. [info] Downloading linux-x64... npm WARN using --force Recommended protections disabled. [info] Downloading linux-arm64... npm WARN using --force Recommended protections disabled. [info] Downloading win32-x64... npm WARN using --force Recommended protections disabled. [info] Building with esbuild... ▲ [WARNING] "./xhr-sync-worker.js" should be marked as external for use with "require.resolve" [require-resolve-not-external]
../core/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:31:57:
31 │ const syncWorkerFile = require.resolve ? require.resolve("./xhr-sync-worker.js") : null;
╵ ~~~~~~~~~~~~~~~~~~~~~~
[info] Building binaries with pkg... [info] Building darwin-x64... node:internal/errors:984 const err = new Error(message); ^
Error: Command failed: npx pkg --no-bytecode --public-packages "*" --public pkgJson/darwin-x64 --out-path bin/darwin-x64 at genericNodeError (node:internal/errors:984:15) at wrappedFn (node:internal/errors:538:14) at checkExecSyncError (node:child_process:890:11) at execSync (node:child_process:962:15) at D:\2024\open_source\CodeGen_C\continue_github\continue\pkg\build.js:122:5 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { status: 2, signal: null, output: [ null, Buffer(263) [Uint8Array] [ 62, 32, 112, 107, 103, 64, 53, 46, 56, 46, 49, 10, 62, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 98, 97, 115, 101, 32, 78, 111, 100, 101, 46, 106, 115, 32, 98, 105, 110, 97, 114, 105, 101, 115, 32, 116, 111, 32, 80, 75, 71, 95, 67, 65, 67, 72, 69, 95, 80, 65, 84, 72, 10, 62, 32, 78, 111, 116, 32, 102, 111, 117, 110, 100, 32, 105, 110, 32, 114, 101, 109, 111, 116, 101, 32, 99, 97, 99, 104, 101, 58, 10, 32, 32, 123, 34, 116, 97, 103, 34, ... 163 more items ], Buffer(0) [Uint8Array] [] ], pid: 33652, stdout: Buffer(263) [Uint8Array] [ 62, 32, 112, 107, 103, 64, 53, 46, 56, 46, 49, 10, 62, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 98, 97, 115, 101, 32, 78, 111, 100, 101, 46, 106, 115, 32, 98, 105, 110, 97, 114, 105, 101, 115, 32, 116, 111, 32, 80, 75, 71, 95, 67, 65, 67, 72, 69, 95, 80, 65, 84, 72, 10, 62, 32, 78, 111, 116, 32, 102, 111, 117, 110, 100, 32, 105, 110, 32, 114, 101, 109, 111, 116, 101, 32, 99, 97, 99, 104, 101, 58, 10, 32, 32, 123, 34, 116, 97, 103, 34, ... 163 more items ], stderr: Buffer(0) [Uint8Array] [] }
Node.js v20.12.1
I was able to workaround the circular dependency build failure by adding this to install-dependencies.sh on line 12:
# temporary workaround for the dependency between gui and extension
pushd extensions/vscode
npm link @continuedev/core
popd
It should be added right after this section (before the gui section):
echo "Installing Core extension dependencies..."
pushd core
npm install
npm link
popd
I tried to add code in install-dependencies.ps1 like this:
Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White Push-Location core npm install npm link Pop-Location
// add this section Push-Location extensions/vscode npm link @continuedev/core Pop-Location // add this section
Write-Output "`nInstalling GUI extension dependencies..." -ForegroundColor White Push-Location gui npm install npm link @continuedev/core npm run build Pop-Location
But build still failed, may be should modify other code?