monaco-languageclient: Build errors: export xx was not found in monaco-editor/esm/vs/platform/files/common/files.js

I’m struggling to build after upgrading to v7.0.2 etc.

I get several export xx was not found in xxx errors:

./node_modules/vscode/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.js:226:48-60 - Error: export 'IFileService' (imported as 'IFileService') was not found in 'monaco-editor/esm/vs/platform/files/common/files.js' (possible exports: FileKind)

./node_modules/vscode/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js:187:45-61 - Error: export 'isSavedWorkspace' (imported as 'isSavedWorkspace') was not found in 'monaco-editor/esm/vs/platform/workspace/common/workspace.js' (possible exports: EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE, IWorkspaceContextService, STANDALONE_EDITOR_WORKSPACE_ID, UNKNOWN_EMPTY_WINDOW_WORKSPACE, WORKSPACE_EXTENSION, WORKSPACE_FILTER, Workspace, WorkspaceFolder, isEmptyWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isStandaloneEditorWorkspace, isWorkspaceIdentifier, toWorkspaceIdentifier)

./node_modules/vscode/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js:229:34-50 - Error: export 'isSavedWorkspace' (imported as 'isSavedWorkspace') was not found in 'monaco-editor/esm/vs/platform/workspace/common/workspace.js' (possible exports: EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE, IWorkspaceContextService, STANDALONE_EDITOR_WORKSPACE_ID, UNKNOWN_EMPTY_WINDOW_WORKSPACE, WORKSPACE_EXTENSION, WORKSPACE_FILTER, Workspace, WorkspaceFolder, isEmptyWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isStandaloneEditorWorkspace, isWorkspaceIdentifier, toWorkspaceIdentifier)

./node_modules/vscode/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js:362:13-33 - Error: export 'isTemporaryWorkspace' (imported as 'isTemporaryWorkspace') was not found in 'monaco-editor/esm/vs/platform/workspace/common/workspace.js' (possible exports: EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE, IWorkspaceContextService, STANDALONE_EDITOR_WORKSPACE_ID, UNKNOWN_EMPTY_WINDOW_WORKSPACE, WORKSPACE_EXTENSION, WORKSPACE_FILTER, Workspace, WorkspaceFolder, isEmptyWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isStandaloneEditorWorkspace, isWorkspaceIdentifier, toWorkspaceIdentifier)

./node_modules/vscode/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js:537:279-311 - Error: export 'IWorkspaceTrustEnablementService' (imported as 'IWorkspaceTrustEnablementService') was not found in 'monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js' (possible exports: IWorkspaceTrustManagementService)

./node_modules/vscode/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js:537:325-337 - Error: export 'IFileService' (imported as 'IFileService') was not found in 'monaco-editor/esm/vs/platform/files/common/files.js' (possible exports: FileKind)

I’m using the following :

{
  "name": "vyne-app",
  "dependencies": {
// only showing the relevant ones...
    "monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.7 <1.84.0",
    "monaco-languageclient": "^7.0.2",
    "vscode-languageclient": "~9.0.1",
    "vscode": "npm:@codingame/monaco-vscode-api@>=1.83.7 <1.84.0",
    "vscode-ws-jsonrpc": "^3.1.0",
  },
  "overrides": {
    "monaco-editor": "$monaco-editor"
    "vscode": "$vscode"
  },
  "resolutions": {
    "monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.7 <1.84.0"
    "vscode": "npm:@codingame/monaco-vscode-api@>=1.83.7 <1.84.0"
  },

For reference, my package.json is available here

I saw this error mentioned on this comment, but it’s not clear how this was fixed.

Any help greatly appreciated!

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 15

Most upvoted comments

No problem. I think, in retrospect, the docs were pretty clear. I was a little thrown by the examples not matching the docs, but that could equally be down to my own lack of experience with package.json format.

Appreciate the speedy responses!

Thanks again

On Tue, 21 Nov 2023, 12:56 Kai Salmen, @.***> wrote:

@martypitt https://github.com/martypitt sorry you had to traverse this muddy road. I updated the troubleshooting section here https://github.com/TypeFox/monaco-languageclient#dependency-issues-monaco-editor--codingamemonaco-editor-treemended. The CHANGELOG and the README already carried a lot of helpful information, but this should help even more.

— Reply to this email directly, view it on GitHub https://github.com/TypeFox/monaco-languageclient/issues/573#issuecomment-1820875094, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACVFNFPHK2EGZIXANBOGWDYFSQGTAVCNFSM6AAAAAA7TVSAHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRQHA3TKMBZGQ . You are receiving this because you were mentioned.Message ID: @.***>

It seems that $monaco-editor just references the version in the dependencies, see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides

you probably have a duplicated dependency, monaco-editor non treemended is used somewhere