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

Invalid host defined options only in production when using dynamic imported ES modules #182493

Closed
felixhaeberle opened this issue May 15, 2023 · 1 comment
Assignees

Comments

@felixhaeberle
Copy link

felixhaeberle commented May 15, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:
    Version: 1.78.2
    Commit: b3e4e68
    Datum: 2023-05-10T15:00:40.428Z
    Electron: 22.5.2
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    Betriebssystem: Darwin arm64 22.4.0
    Sandkasten: No

  • OS Version:
    macOS Ventura 13.3.1

Steps to Reproduce:

  1. Look at this repository https://github.com/inlang/inlang/tree/main/source-code/ide-extension using dynamic import at
    https://github.com/inlang/inlang/blob/256cf7cd79ae7b74b75c73215aa4b4954ec097e7/source-code/ide-extension/src/main.ts#L80

This extension is released in the Visual Studio Marketplace because this bug only happens in production, not local.
You can install it here: https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension
See install instruction, you have to create a file called inlang.config.js. The activation event is triggered by this file and it's content (see README).

  1. Look in the developer tools of VS Code, there the error of "Invalid host defined options" appears in producion only, when running the extension locally, there are no problems. I'm bundling the extension with esbuild as it can be seen in the repository.
Bildschirmfoto 2023-05-15 um 12 36 07

Question

What's the reason that this only works locally and not when bundled in production? Is there a bug on my side or something wrong in the VS Code module resolution?

This is the issue with more information on the research which I have already done:

opral/monorepo#736

@roblourens
Copy link
Member

Do you have a different dev build setup vs prod that is run when you publish the extension? I think that is the most likely explanation, I can't think of anything that we do differently based on whether the extension came from the marketplace that would impact how your extension code is loaded.

The error message isn't from vscode, when I google it I see lots of results about different webpack configurations.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants